Single-photo SVBRDF capture
A rendering-aware CNN predicts diffuse, specular, roughness and normal maps from one flash-lit photo of a flat material sample. Gives an instant starting material from a phone picture.
In the family Materials, BRDFs & texturing, material capture
Where it runs
Built inOfficial add-onPluginNone foundNot researched
| Engine | Support | How |
|---|---|---|
| three.js r187 | None found | |
| Babylon.js 9.38.0 | None found | |
| Godot 4.7 | None found | No built-in single-photo SVBRDF material capture pipeline. |
| Unity | None found | |
| Unreal 5.7 | None found | No built-in single-photo SVBRDF material capture pipeline. |
| Blender 5.2 | None found | |
| WebGPU W3C | None found | |
| Metal | None found |
How it works
Deschaintre et al. train a U-Net-like network with a global feature track that propagates image-wide context to every pixel, so highlights in one region inform appearance elsewhere. Training data are procedurally mixed SVBRDF maps rendered under a near-field flash light with a microfacet model. The loss is a mix of L1 error on predicted maps and a differentiable rendering loss comparing renders of predicted and ground-truth maps under random lighting, which resolves ambiguities where multiple maps explain the same photo. At inference the output is a set of four maps (diffuse albedo, specular albedo, roughness, normals) on a Cook-Torrance-GGX style model. A multi-image follow-up (Deschaintre 2019) accepts any number of photos with different light positions and pools features order-invariantly.
When to choose it
Reach for it when
- want pbr maps from one phone photo of a surface
- need quick material scan of flat sample
- no rig for capturing roughness and normals
- seed a texture set artists can refine
Choose it for quick material scanning of flat samples, or to seed PBR textures that artists refine. Prefer photometric stereo (Photometric Stereo) or gantry-based capture when accuracy matters. Prefer Procedural noise for texturing for fully procedural materials. Use Normal mapping with MikkTSpace conventions for output normals.
Field marks
- Baked-in highlights and shadows leak into albedo when lighting is not near the training distribution
- Domain gap on real photos: glossy or anisotropic materials are mispredicted
- Output is limited to flat, tileable-ish samples; 3D structures confuse height and shading
- Resolution fixed by network input, producing blurry fine detail without upsampling
Presets
Single-Photo SVBRDF Capture — flash-lit photo & predicted maps (left) vs relit reconstructed 3D material (right)
{
"P_FLASH_INT": 1.2,
"P_RELIGHT_ANG": 0.65,
"P_RELIEF": 0.9,
"P_SPLIT": 0.48
}Show GLSL (159 lines)
const float P_FLASH_INT = 1.20; // P Flash Hotspot [0.4, 2.2, 0.1]
const float P_RELIGHT_ANG = 0.65; // P Relight Orbit [0.0, 2.0, 0.05]
const float P_RELIEF = 0.90; // P Normal Depth [0.2, 1.6, 0.05]
const float P_SPLIT = 0.48; // P Flash / Relit Split [0.0, 1.0, 0.02]
float hash21(vec2 p) {
p = fract(p * vec2(127.1, 311.7));
p += dot(p, p + 34.5);
return fract(p.x * p.y);
}
float vnoise(vec2 p) {
vec2 i = floor(p);
vec2 f = fract(p);
f = f * f * (3.0 - 2.0 * f);
return mix(
mix(hash21(i), hash21(i + vec2(1.0, 0.0)), f.x),
mix(hash21(i + vec2(0.0, 1.0)), hash21(i + vec2(1.0, 1.0)), f.x),
f.y
);
}
float fbm(vec2 p) {
float s = 0.0, a = 0.5;
for (int i = 0; i < 4; i++) {
s += a * vnoise(p);
p *= 2.03;
a *= 0.5;
}
return s;
}
// Underlying stone-and-patinated-copper tile SVBRDF maps
void evalSVBRDF(vec2 uv, float relief, out vec3 alb, out vec3 tn, out float rough, out float specF0) {
vec2 tile = uv * vec2(4.0, 6.0);
float row = floor(tile.y);
tile.x += mod(row, 2.0) * 0.5;
vec2 id = floor(tile);
vec2 f = fract(tile) - 0.5;
float mortar = smoothstep(0.43, 0.48, max(abs(f.x), abs(f.y)));
float n1 = fbm(uv * 9.0 + id * 0.37);
float n2 = fbm(uv * 22.0 + 4.1);
float tileRnd = hash21(id);
vec3 stoneA = vec3(0.46, 0.26, 0.18);
vec3 stoneB = vec3(0.24, 0.38, 0.36);
vec3 tileCol = mix(stoneA, stoneB, smoothstep(0.35, 0.72, tileRnd + (n1 - 0.5) * 0.35));
alb = mix(tileCol * (0.72 + 0.55 * n2), vec3(0.22, 0.21, 0.19), mortar);
rough = clamp(mix(0.26 + 0.35 * (1.0 - n1), 0.88, mortar), 0.12, 0.95);
specF0 = mix(0.06 + 0.14 * smoothstep(0.55, 0.85, tileRnd), 0.02, mortar);
// Normal gradient from bevel + micro-relief
vec2 bev = smoothstep(0.36, 0.46, abs(f)) * sign(f);
float eps = 0.01;
float hx = fbm((uv + vec2(eps, 0.0)) * 18.0) - fbm(uv * 18.0);
float hy = fbm((uv + vec2(0.0, eps)) * 18.0) - fbm(uv * 18.0);
tn = normalize(vec3(-(bev.x * 0.85 + hx * 4.5) * relief, -(bev.y * 0.85 + hy * 4.5) * relief, 1.0));
}
float D_GGX(float ndh, float a) {
float a2 = a * a;
float d = ndh * ndh * (a2 - 1.0) + 1.0;
return a2 / max(3.1415926 * d * d, 1e-5);
}
vec3 aces(vec3 x) {
x = max(x, 0.0);
return (x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14);
}
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);
float split = clamp(P_SPLIT, 0.0, 1.0);
bool showRelit = sx >= split;
float flashPow = clamp(P_FLASH_INT, 0.2, 2.6);
float orb = iTime * max(P_RELIGHT_ANG, 0.0);
float relief = clamp(P_RELIEF, 0.1, 2.0);
vec3 col = vec3(0.05, 0.06, 0.08);
if (!showRelit) {
// Left: Flat phone flash-capture photo (top 68%) + CNN predicted SVBRDF map strip (bottom 32%)
float sy = fragCoord.y / max(iResolution.y, 1.0);
if (sy > 0.30) {
vec2 puv = vec2(sx / max(split, 0.05), (sy - 0.30) / 0.70);
vec3 alb, tn; float rough, f0;
evalSVBRDF(puv, relief, alb, tn, rough, f0);
// Co-located camera + point flash at center (0.5, 0.5, 0.55)
vec3 surfP = vec3(puv - 0.5, 0.0);
vec3 camP = vec3(0.0, 0.0, 0.58);
vec3 L = normalize(camP - surfP);
float dist2 = dot(camP - surfP, camP - surfP);
float ndl = max(dot(tn, L), 0.0);
float D = D_GGX(ndl, max(rough * rough, 0.05));
float atten = flashPow / max(dist2 * 1.9, 0.2);
col = (alb * ndl * 0.9 + vec3(D * f0 * 0.45)) * atten + alb * 0.06;
} else {
// Bottom CNN output map strip: Albedo | Normal | Roughness | Specular
float bx = (sx / max(split, 0.05)) * 4.0;
int idx = int(clamp(floor(bx), 0.0, 3.0));
vec2 muv = vec2(fract(bx), sy / 0.30);
vec3 alb, tn; float rough, f0;
evalSVBRDF(muv * 0.75, relief, alb, tn, rough, f0);
if (idx == 0) col = alb * 1.1;
else if (idx == 1) col = tn * 0.5 + 0.5;
else if (idx == 2) col = vec3(rough);
else col = vec3(f0 * 4.5);
// Crisp border between predicted maps
if (fract(bx) < 0.03 || fract(bx) > 0.97 || sy > 0.285) col = vec3(0.85, 0.88, 0.94);
}
} else {
// Right: Reconstructed SVBRDF relit on a 3D curved cylinder/sphere under orbiting directional + cool IBL
vec3 ro = vec3(0.18, 0.05, 2.20);
vec3 rd = normalize(vec3(uv - vec2(0.14, 0.0), -1.48));
col = mix(vec3(0.05, 0.07, 0.11), vec3(0.16, 0.22, 0.34), smoothstep(-0.3, 0.6, rd.y));
vec3 sc = vec3(0.18, 0.0, 0.0);
vec3 oc = ro - sc;
float b = dot(oc, rd);
float c = dot(oc, oc) - 0.62 * 0.62;
float disc = b * b - c;
if (disc > 0.0) {
float t = -b - sqrt(disc);
if (t > 0.05) {
vec3 p = ro + rd * t;
vec3 n = normalize(p - sc);
float phi = atan(n.z, n.x) + orb * 0.35;
float th = acos(clamp(n.y, -1.0, 1.0));
vec2 muv = vec2(phi / 3.14159, th / 1.57079);
vec3 T = normalize(vec3(-sin(phi), 0.0, cos(phi)));
vec3 B = cross(n, T);
vec3 alb, tn; float rough, f0;
evalSVBRDF(muv, relief, alb, tn, rough, f0);
vec3 wN = normalize(T * tn.x + B * tn.y + n * tn.z);
vec3 v = -rd;
vec3 L1 = normalize(vec3(cos(orb) * 0.85, 0.65, sin(orb) * 0.65 + 0.45));
vec3 L2 = normalize(vec3(-0.7, 0.35, 0.55));
vec3 H1 = normalize(L1 + v);
float ndl1 = max(dot(wN, L1), 0.0);
float ndl2 = max(dot(wN, L2), 0.0);
float ndh1 = max(dot(wN, H1), 0.0);
float ndv = max(dot(wN, v), 0.005);
float D = D_GGX(ndh1, max(rough * rough, 0.05));
float F = f0 + (1.0 - f0) * pow(1.0 - max(dot(v, H1), 0.0), 5.0);
vec3 spec = vec3(1.15, 1.05, 0.90) * (D * F / max(4.0 * ndv, 0.08)) * ndl1;
vec3 diff = alb * (vec3(1.25, 1.08, 0.88) * ndl1 + vec3(0.32, 0.52, 0.85) * ndl2 * 0.65 + vec3(0.12, 0.16, 0.22));
col = diff + spec;
}
}
}
float sep = smoothstep(0.0035, 0.0008, abs(sx - split));
col = mix(col, vec3(0.95, 0.97, 1.0), sep);
fragColor = vec4(pow(clamp(aces(col), 0.0, 1.0), vec3(1.0 / 2.2)), 1.0);
}Attribution: MIT — written for this index.
Measured GPU weight & timing
| Preset | GPU | Weight / p50 / p95 | Method |
|---|---|---|---|
| svbrdf-single-photo-capture-live | Tesla T4 1920x1080 | 20.3× baseline (heavy) · 0.666 ms / 0.690 ms | opengl-timer-query · 32 frames · GPU Weight Atlas · Colab T4 sweep |
| svbrdf-single-photo-capture-live | NVIDIA L4 1920x1080 | 17.6× baseline (moderate) · 0.280 ms / 0.282 ms · 2.4× faster on L4 | opengl-timer-query · Cross-architecture validation |
| svbrdf-single-photo-capture-live | NVIDIA A100-SXM4-40GB 1920x1080 | 14.9× baseline (moderate) · 0.428 ms / 0.429 ms · 1.6× faster on A100 | opengl-timer-query · Cross-architecture validation |
Lineage
From the citation graph (Crossref reference lists): its primary source cites Cook-Torrance microfacet BRDF; cited by Mesh Neural Cellular Automata (MeshNCA).
Crosses
- One phone photo, a whole floor: A flash photo of a small material patch becomes a PBR material that covers a large area without visible repetition. Every map is quilted with the same seams and tiled with the same hex offsets, so albedo, normal and roughness stay registered.
Sources
- primaryValentin Deschaintre, Miika Aittala, Fredo Durand, George Drettakis, Adrien Bousseau (2018). Single-image SVBRDF capture with a rendering-aware deep network. ACM Transactions on Graphics.Verified via crossref · 2026-11-29doi:10.1145/3197517.3201378
- primaryValentin Deschaintre, Miika Aittala, Fredo Durand, George Drettakis, Adrien Bousseau (2019). Flexible SVBRDF Capture with a Multi‐Image Deep Network. Computer Graphics Forum.Verified via crossref · 2026-11-29doi:10.1111/cgf.13765