---
id: "rgb-x-intrinsic-decomposition"
title: "RGB↔X: Diffusion Intrinsic Decomposition & Neural Rendering"
aliases: [RGB-X, RGB<->X]
domain: "genai"
stage: "generation"
realtime: "offline"
platforms: [cuda, desktop-gpu]
year_introduced: 2024
inputs: [photos, material-params]
outputs: [material-params, normals, irradiance-probes, ldr-image]
style: "photoreal"
dynamic: "static"
cost: "heavy"
authority: "Zeng et al., 2024"
url: "https://texelatlas.vercel.app/t/rgb-x-intrinsic-decomposition/"
sources_verified_at: "2026-12-02"
---
# RGB↔X: Diffusion Intrinsic Decomposition & Neural Rendering (Zeng et al., 2024)

> A bidirectional diffusion framework that decomposes any photograph into PBR intrinsic channels (albedo, normal, roughness, metallic, irradiance) and synthesizes photorealistic relit images back from partial or edited intrinsic channels.

## How it works

RGB→X fine-tunes a latent diffusion model conditioned on an input photo and channel selector prompt to predict albedo, surface normals, roughness, metalness, and diffuse irradiance maps—even for complex indoor/outdoor scenes with indirect light. Conversely, X→RGB accepts any subset of intrinsic buffers (for example, edited albedo or a new lighting pass) and synthesizes a coherent, physically plausible photorealistic image with realistic shadows and inter-reflections.

## When to use it

Choose for single-photo PBR extraction, neural relighting, material replacement in real photos, or turning rough G-buffer renders into photorealistic look-dev concepts.

## Cost

heavy — Latent diffusion inference per channel/image (seconds on a desktop GPU); offline or interactive look-dev.

## Failure modes

- Cross-channel alignment can drift slightly across independent diffusion draws
- Lacks strict multi-view 3D consistency without explicit 3D projection/baking
- Strong cast shadows occasionally leak weakly into predicted albedo

## Dataflow

- Inputs: photos, material-params
- Outputs: material-params, normals, irradiance-probes, ldr-image
- Platforms: cuda, desktop-gpu

## Presets

### RGB↔X — RGB beauty / Albedo / Roughness / Irradiance intrinsic channel decomposition (glsl-fragment; rendered 2026-12-02)

```json
{
  "P_MODE": 0,
  "P_LIGHT_ANG": 0.6
}
```

```glsl
const float P_MODE = 0.0; // P Channel (0=Split,1=Alb,2=Rough,3=Irr) [0.0, 3.0, 1.0]
const float P_LIGHT_ANG = 0.6; // P Light Azimuth [0.0, 6.28, 0.05]

void mainImage(out vec4 fragColor, in vec2 fragCoord) {
  vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;
  float sx = fragCoord.x / max(iResolution.x, 1.0);
  vec3 ro = vec3(0.0, 0.15, 2.5);
  vec3 rd = normalize(vec3(uv, -1.5));
  float b = dot(ro, rd), c = dot(ro, ro) - 0.72 * 0.72;
  float disc = b * b - c;
  vec3 bg = vec3(0.06, 0.07, 0.10);
  vec3 rgb = bg, alb = bg, rgh = bg, irr = bg;
  if (disc > 0.0) {
    float t = -b - sqrt(disc);
    vec3 p = ro + rd * t;
    vec3 n = normalize(p);
    float band = smoothstep(-0.08, 0.08, sin(p.y * 10.0 + p.x * 4.0));
    alb = mix(vec3(0.76, 0.34, 0.20), vec3(0.22, 0.48, 0.64), band);
    float roughVal = mix(0.18, 0.82, band);
    rgh = vec3(roughVal);
    vec3 lDir = normalize(vec3(cos(P_LIGHT_ANG + iTime * 0.35), 0.75, sin(P_LIGHT_ANG + iTime * 0.35)));
    float diff = max(dot(n, lDir), 0.0);
    irr = vec3(0.22, 0.26, 0.36) + vec3(1.15, 0.96, 0.78) * diff;
    float spec = pow(max(dot(n, normalize(lDir - rd)), 0.0), mix(96.0, 8.0, roughVal));
    rgb = alb * irr + vec3(0.95) * spec * (1.0 - roughVal * 0.75);
  }
  int m = int(floor(P_MODE + 0.5));
  vec3 outC = (m == 1) ? alb : (m == 2 ? rgh : (m == 3 ? irr : (sx < 0.25 ? rgb : (sx < 0.50 ? alb : (sx < 0.75 ? rgh : irr)))));
  if (m == 0) {
    float d1 = min(abs(sx - 0.25), min(abs(sx - 0.50), abs(sx - 0.75)));
    outC = mix(outC, vec3(0.95), smoothstep(0.003, 0.001, d1));
  }
  outC = (outC * (2.51 * outC + 0.03)) / (outC * (2.43 * outC + 0.59) + 0.14);
  fragColor = vec4(pow(clamp(outC, 0.0, 1.0), vec3(1.0 / 2.2)), 1.0);
}
```

Attribution: MIT — written for this index.

## Lineage

- extends [Disney principled BRDF](https://texelatlas.vercel.app/t/disney-principled-brdf.md)

## Sources

1. [primary] Zheng Zeng, Valentin Deschaintre, Iliyan Georgiev, Yannick Hold-Geoffroy, Yiwei Hu, Fujun Luan, Ling-Qi Yan, Miloš Hašan (2024) RGB↔X: Image decomposition and synthesis using material- and lighting-aware diffusion models. Special Interest Group on Computer Graphics and Interactive Techniques Conference Conference Papers. https://doi.org/10.1145/3641519.3657445 (verified via crossref on 2026-12-02)

## Cite this entry

Texel. "RGB↔X: Diffusion Intrinsic Decomposition & Neural Rendering." https://texelatlas.vercel.app/t/rgb-x-intrinsic-decomposition/ (accessed 2026-12-02).
