Texel A field guide to 3D techniques

Semi-Sharp Creases × SDF Ambient Occlusion × SyncMVD

Crease sharpness steers generated wear. Sharpness values an artist sets on a subdivision cage become a control channel for a texture generator. Baked SDF occlusion and curvature tell it where grime and edge wear belong, so generated detail agrees with the geometry.

Open in StudioReproduced29.7× · 0.922 ms

Semi-Sharp CreasesGeometry · Real-timein: meshout: meshcompositeSDF Ambient OcclusionVisibility · Real-timein: sdf, normals, depthout: visibility-mask, normalscompositeSyncMVDGeneration · Interactivein: mesh, text-promptout: texture, uv-atlas

Verified proof

reproduced · 2026-12-01texel-lablicense MIT
Specimen render of Crease-aware generative wear (left: uniform weathered patina, right: semi-sharp curvature polish + SDF-AO crevice verdigris)
Cross-proof specimen. Crease-aware generative wear (left: uniform weathered patina, right: semi-sharp curvature polish + SDF-AO crevice verdigris). Verified WebGL2 proof · 2026-12-01

Split-screen WebGL2 proof comparing uniformly weathered bronze armor geometry ignoring crease sharpness and cavity occlusion (left, looking flat and procedurally painted) against semi-sharp subdivision crease curvature plus SDF ambient occlusion steering dual-channel generative wear where sharp bevels polish into bright bare brass while deep concave crevices accumulate rough dark verdigris patina (right).

Chromium Headless ANGLE/SwiftShader WebGL2 · 512x512 · couples interactive semi-sharp crease sharpness and SDF ambient occlusion directly into coherent edge-polish and crevice-patina PBR maps

Show GLSL proof (174 lines)
const float P_CREASE_SHARP = 0.78; // P Crease Sharpness [0.15, 0.98, 0.02]
const float P_EDGE_WEAR = 1.15; // P Edge Polish Gain [0.0, 2.0, 0.05]
const float P_GRIME_AO = 1.20; // P Crevice Patina [0.0, 2.2, 0.05]
const float P_TURNTABLE = 0.35; // P Turntable Speed [0.0, 1.0, 0.05]

mat2 rot2(float a) {
  float c = cos(a), s = sin(a);
  return mat2(c, -s, s, c);
}

float smin(float a, float b, float k) {
  float h = clamp(0.5 + 0.5 * (b - a) / max(k, 1e-4), 0.0, 1.0);
  return mix(b, a, h) - k * h * (1.0 - h);
}

float sdRoundBox(vec3 p, vec3 b, float r) {
  vec3 q = abs(p) - b;
  return length(max(q, 0.0)) + min(max(q.x, max(q.y, q.z)), 0.0) - r;
}

// Sculpted bronze reliquary artifact whose bevel radius & flange creases respond live to P_CREASE_SHARP
float mapArtifact(vec3 p) {
  float bev = mix(0.11, 0.016, P_CREASE_SHARP);
  float core = sdRoundBox(p, vec3(0.46, 0.46, 0.46) - vec3(bev), bev);
  // Equatorial bolted belt rib
  float belt = sdRoundBox(p, vec3(0.54, 0.11, 0.54) - vec3(bev * 0.8), bev * 0.8);
  // Vertical corner buttresses
  vec3 q = p;
  q.xz = abs(q.xz) - vec2(0.36, 0.36);
  float fin = sdRoundBox(q, vec3(0.11, 0.50, 0.11) - vec3(bev * 0.7), bev * 0.7);
  float d = smin(core, belt, mix(0.08, 0.015, P_CREASE_SHARP));
  d = smin(d, fin, mix(0.07, 0.014, P_CREASE_SHARP));
  // Recessed circular medallion sockets on front & side faces
  float sockZ = length(vec2(length(p.xy) - 0.19, abs(p.z) - 0.47)) - 0.065;
  float sockX = length(vec2(length(p.yz) - 0.19, abs(p.x) - 0.47)) - 0.065;
  d = max(d, -min(sockZ, sockX));
  return d;
}

vec3 calcNormal(vec3 p) {
  vec2 e = vec2(0.0025, -0.0025);
  return normalize(
    e.xyy * mapArtifact(p + e.xyy) +
    e.yyx * mapArtifact(p + e.yyx) +
    e.yxy * mapArtifact(p + e.yxy) +
    e.xxx * mapArtifact(p + e.xxx)
  );
}

// SDF Laplacian mean curvature proxy: positive on sharp convex edges, negative in concave grooves
float sdfCurvature(vec3 p) {
  float e = 0.022;
  float c = mapArtifact(p);
  float lap = (mapArtifact(p + vec3(e, 0.0, 0.0)) + mapArtifact(p - vec3(e, 0.0, 0.0))
             + mapArtifact(p + vec3(0.0, e, 0.0)) + mapArtifact(p - vec3(0.0, e, 0.0))
             + mapArtifact(p + vec3(0.0, 0.0, e)) + mapArtifact(p - vec3(0.0, 0.0, e)) - 6.0 * c) / (e * e);
  return clamp(lap * 0.048, -1.0, 1.0);
}

// Multi-step cone-sampled SDF ambient occlusion
float sdfAO(vec3 p, vec3 n) {
  float occ = 0.0;
  float w = 1.0;
  for (int i = 1; i <= 5; i++) {
    float h = 0.025 + 0.045 * float(i);
    float d = mapArtifact(p + n * h);
    occ += max(h - d, 0.0) * w;
    w *= 0.62;
  }
  return clamp(1.0 - occ * 2.8, 0.0, 1.0);
}

// Subtle organic surface grain mimicking generative texture micro-detail
float surfaceNoise(vec3 p) {
  vec3 q = p * 14.0;
  float n1 = sin(q.x + sin(q.y * 1.3 + q.z)) * cos(q.z * 1.1 + sin(q.x * 1.2));
  float n2 = sin(q.x * 2.7 - q.y * 2.3) * cos(q.y * 2.9 + q.z * 2.5);
  return 0.5 + 0.35 * n1 + 0.15 * n2;
}

vec3 acesTone(vec3 x) {
  return clamp((x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14), 0.0, 1.0);
}

void mainImage(out vec4 fragColor, in vec2 fragCoord) {
  vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;
  bool useCreaseWear = uv.x > 0.0;
  vec2 suv = vec2(useCreaseWear ? (uv.x - 0.25) : (uv.x + 0.25), uv.y);
  suv.x *= 1.80;

  float ang = 0.65 + iTime * P_TURNTABLE;
  vec3 ro = vec3(sin(ang) * 2.15, 0.72, cos(ang) * 2.15);
  vec3 fwd = normalize(-ro);
  vec3 right = normalize(cross(vec3(0.0, 1.0, 0.0), fwd));
  vec3 up = cross(fwd, right);
  vec3 rd = normalize(fwd * 1.78 + right * suv.x + up * suv.y);

  vec3 bg = mix(vec3(0.04, 0.045, 0.055), vec3(0.11, 0.125, 0.15), clamp(suv.y + 0.55, 0.0, 1.0));
  vec3 col = bg;

  float t = 0.0;
  bool hit = false;
  for (int i = 0; i < 64; i++) {
    float d = mapArtifact(ro + rd * t);
    if (d < 0.0015) { hit = true; break; }
    t += d * 0.85;
    if (t > 5.0) break;
  }

  if (hit) {
    vec3 p = ro + rd * t;
    vec3 n = calcNormal(p);
    vec3 V = -rd;
    float grain = surfaceNoise(p);
    float ao = sdfAO(p, n);
    float curv = sdfCurvature(p);

    // Base aged dark bronze, bright bare-edge brass, and oxidized turquoise verdigris patina
    vec3 bronze = vec3(0.32, 0.22, 0.14) * (0.82 + 0.36 * grain);
    vec3 bareBrass = vec3(0.95, 0.76, 0.40);
    vec3 verdigris = vec3(0.16, 0.48, 0.42) * (0.78 + 0.40 * grain);

    vec3 alb = bronze;
    float rough = 0.42;
    float metal = 0.82;

    if (!useCreaseWear) {
      // Left: uniform unguided procedural weathering ignoring crease sharpness and crevice AO
      float unifPatina = smoothstep(0.45, 0.85, grain) * 0.42;
      alb = mix(bronze, verdigris, unifPatina);
      rough = mix(0.42, 0.72, unifPatina);
      metal = mix(0.80, 0.25, unifPatina);
    } else {
      // Right: semi-sharp curvature polishes sharp edges to bright brass; low SDF-AO cavities collect verdigris
      float edgeMask = smoothstep(0.08, 0.48, curv * (0.65 + 0.55 * grain)) * P_EDGE_WEAR;
      edgeMask = clamp(edgeMask, 0.0, 1.0);
      float creviceMask = smoothstep(0.76, 0.28, ao - 0.14 * grain) * P_GRIME_AO;
      creviceMask = clamp(creviceMask, 0.0, 1.0);

      alb = mix(bronze, verdigris, creviceMask);
      alb = mix(alb, bareBrass, edgeMask);
      rough = mix(0.38, 0.86, creviceMask);
      rough = mix(rough, 0.12, edgeMask);
      metal = mix(0.84, 0.10, creviceMask);
      metal = mix(metal, 0.98, edgeMask);
    }

    // Studio three-point PBR lighting (warm key + cool rim + environment specular)
    vec3 L1 = normalize(vec3(0.65, 0.78, 0.48));
    vec3 L2 = normalize(vec3(-0.72, 0.22, -0.58));
    float ndl1 = max(dot(n, L1), 0.0);
    float ndl2 = max(dot(n, L2), 0.0);
    float ndv = max(dot(n, V), 0.02);

    vec3 F0 = mix(vec3(0.04), alb, metal);
    vec3 H1 = normalize(L1 + V);
    float a2 = max(rough * rough, 0.008);
    float d1 = max(dot(n, H1), 0.0);
    float denom = d1 * d1 * (a2 - 1.0) + 1.0;
    float D = a2 / (3.14159265 * denom * denom);
    vec3 F = F0 + (1.0 - F0) * pow(1.0 - max(dot(H1, V), 0.0), 5.0);

    vec3 diff = alb * (1.0 - metal) * (vec3(1.55, 1.42, 1.24) * ndl1 + vec3(0.38, 0.54, 0.78) * ndl2 + vec3(0.18, 0.22, 0.28) * ao);
    vec3 spec = F * D * vec3(1.65, 1.50, 1.32) * (0.25 + 0.75 * ndl1) * 0.35;
    vec3 R = reflect(-V, n);
    vec3 env = mix(vec3(0.06, 0.08, 0.12), vec3(0.58, 0.62, 0.70), smoothstep(-0.2, 0.8, R.y));
    env += vec3(1.1, 0.95, 0.78) * pow(max(dot(R, L1), 0.0), mix(4.0, 28.0, 1.0 - rough)) * 0.65;
    col = diff + spec + env * F * (1.0 - 0.68 * rough) * (0.35 + 0.65 * ao);
  }

  col = acesTone(col);
  if (abs(uv.x) < 0.003) col = vec3(0.95, 0.93, 0.89);
  fragColor = vec4(pow(clamp(col, 0.0, 1.0), vec3(1.0 / 2.2)), 1.0);
}

Why they connect

Semi-Sharp Creases evaluates the cage into a mesh whose bevels follow per-edge sharpness, and that mesh goes to SyncMVD as its mesh input. In parallel the mesh is baked into a distance field (a composite hop, since mesh to sdf needs a bake), and SDF Ambient Occlusion samples it to produce occlusion (visibility-mask) and bent normals, with curvature taken from the same field. These maps are rendered from each SyncMVD camera and supplied as extra conditioning next to depth; this hop is also composite, as visibility-mask is not a SyncMVD io-type. The generator outputs a texture and uv-atlas, and AO and curvature are reused as roughness masks.

How to build it

Blender with OpenSubdiv: evaluate the creased cage at display level and export. Bake a narrow-band SDF on the GPU or with a BVH closest-point query, compute SDF AO per texel and curvature from the field's Laplacian, and bake both to the UV atlas. Run SyncMVD with its depth ControlNet plus a second ControlNet branch (a soft-edge or line-art model) fed with rendered curvature, and a prompt naming the wear you want. Then build PBR channels: roughness from a base value modulated by AO (grime is rougher) and curvature (worn edges are smoother), and a metal mask from the prompt's material. Iterate by changing sharpness values and re-baking rather than rewriting the prompt.

Field marks

  1. A ControlNet trained on line art may read curvature maps as outlines and draw them.
  2. Baked shading from the 2D model fights the AO-driven roughness.
  3. SDF resolution blurs small creases, losing their curvature signal.
  4. Extra conditioning can over-constrain the generator and reduce detail.

Prior art

  1. MVPainter: Accurate and Detailed 3D Texture Generation via Multi-View Diffusion with Geometric Control. Partial: adds ControlNet-based geometric conditioning to multi-view texture diffusion and extracts PBR attributes, but does not condition on baked occlusion, curvature or crease sharpness.
Searches run (4)
  • arXiv: all:"texture generation" AND all:"ambient occlusion" AND all:"curvature" → 0 results
  • GitHub repos: "texture generation" "ambient occlusion" curvature → 0 results
  • arXiv: all:"multi-view diffusion" AND all:"texturing" AND all:"ControlNet" → 2 results
  • GitHub repos: "multi-view diffusion" texturing ControlNet → 0 results