---
id: "svbrdf-single-photo-capture"
title: "Single-photo SVBRDF capture"
domain: "materials"
stage: "material"
realtime: "interactive"
platforms: [python, cuda]
year_introduced: 2018
inputs: [photos]
outputs: [material-params, texture]
style: "photoreal"
dynamic: "static"
cost: "offline"
authority: "Deschaintre et al., 2018"
url: "https://texelatlas.vercel.app/t/svbrdf-single-photo-capture/"
sources_verified_at: "2026-11-29"
---
# Single-photo SVBRDF capture (Deschaintre et al., 2018)

> 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.

## 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

## 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 use it

Choose it for quick material scanning of flat samples, or to seed PBR textures that artists refine. Prefer photometric stereo ([Photometric Stereo](https://texelatlas.vercel.app/t/photometric-stereo.md)) or gantry-based capture when accuracy matters. Prefer [Procedural noise for texturing](https://texelatlas.vercel.app/t/procedural-noise-texturing.md) for fully procedural materials. Use [Normal mapping with MikkTSpace](https://texelatlas.vercel.app/t/normal-mapping-mikktspace.md) conventions for output normals.

## Cost

offline — Single forward pass is fast (milliseconds on GPU) but the output is for authoring, not per-frame.
Measured GPU Weight: 20.25× baseline (heavy) — 0.6663 ms median / 0.6902 ms p95 on Tesla T4/PCIe/SSE2 @ 1920x1080 (opengl-timer-query).
Ada L4 scaling: 17.64× baseline (moderate) — 0.2804 ms median (2.38× faster on L4).
Ampere A100 scaling: 14.86× baseline (moderate) — 0.4279 ms median (1.56× faster on A100).

## Failure modes

- 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

## Dataflow

- Inputs: photos
- Outputs: material-params, texture
- Platforms: python, cuda

## Presets

### Single-Photo SVBRDF Capture — flash-lit photo & predicted maps (left) vs relit reconstructed 3D material (right) (glsl-fragment; rendered 2026-11-30)

```json
{
  "P_FLASH_INT": 1.2,
  "P_RELIGHT_ANG": 0.65,
  "P_RELIEF": 0.9,
  "P_SPLIT": 0.48
}
```

```glsl
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.

## Combination ideas

- [One phone photo, a whole floor](https://texelatlas.vercel.app/ideas/one-photo-endless-material/)

## Sources

1. [primary] Valentin Deschaintre, Miika Aittala, Fredo Durand, George Drettakis, Adrien Bousseau (2018) Single-image SVBRDF capture with a rendering-aware deep network. ACM Transactions on Graphics. https://doi.org/10.1145/3197517.3201378 (verified via crossref on 2026-11-29)
2. [primary] Valentin Deschaintre, Miika Aittala, Fredo Durand, George Drettakis, Adrien Bousseau (2019) Flexible SVBRDF Capture with a Multi‐Image Deep Network. Computer Graphics Forum. https://doi.org/10.1111/cgf.13765 (verified via crossref on 2026-11-29)

## Cite this entry

Texel. "Single-photo SVBRDF capture." https://texelatlas.vercel.app/t/svbrdf-single-photo-capture/ (accessed 2026-12-01).
