---
id: "clay"
title: "CLAY"
domain: "genai"
stage: "generation"
realtime: "offline"
platforms: [cuda, python]
year_introduced: 2024
inputs: [text-prompt, ldr-image]
outputs: [mesh, material-params]
style: "both"
dynamic: "static"
cost: "offline"
authority: "Zhang et al., 2024"
url: "https://texelatlas.vercel.app/t/clay/"
sources_verified_at: "2026-11-29"
---
# CLAY (Zhang et al., 2024)

> A large controllable 3D generator that trains a multi-resolution geometry VAE and a diffusion transformer on 3D data, then adds a material-diffusion stage for PBR textures.

## Reach for it when

- generate high quality 3d assets with pbr textures from text
- want a native 3d diffusion model with material output
- need reference for large controllable 3d generators
- generated geometry should come with roughness and metallic maps

## How it works

Geometry is encoded from sampled surface points into a compact latent with a VAE, and a diffusion transformer learns to generate that latent from text, images, point clouds, voxels or bounding boxes, giving several control channels. After the shape is decoded and meshed, a second diffusion model that works on multi-view renders generates PBR material maps (albedo, roughness, metallic) and projects them into UV space. The paper stresses a data-curation and scale recipe: the quality gain comes from large cleaned 3D data and model capacity rather than a new loss.

## When to use it

Choose it as the reference for native-3D latent diffusion with PBR output, noting that I found a paper but no public repository or weights. Prefer open pipelines [Hunyuan3D 2.1](https://texelatlas.vercel.app/t/hunyuan3d-2-1.md), [TRELLIS.2 (O-Voxel structured latents)](https://texelatlas.vercel.app/t/trellis-2.md) or [TRELLIS (Structured 3D Latents)](https://texelatlas.vercel.app/t/trellis.md) when you need runnable code.

## Cost

offline — No public weights or repository found, so no inference cost data.
Measured GPU Weight: 15.81× baseline (moderate) — 0.5202 ms median / 0.5426 ms p95 on Tesla T4/PCIe/SSE2 @ 1920x1080 (opengl-timer-query).
Ada L4 scaling: 13.56× baseline (moderate) — 0.2156 ms median (2.41× faster on L4).
Ampere A100 scaling: 10.85× baseline (moderate) — 0.3126 ms median (1.66× faster on A100).

## Failure modes

- Cannot be reproduced locally: closed model and data
- PBR maps are inferred from images and can contradict the real material
- Mesh topology is dense and unstructured
- Prompt control is coarse for fine part-level edits

## Dataflow

- Inputs: text-prompt, ldr-image
- Outputs: mesh, material-params
- Platforms: cuda, python

## Presets

### CLAY — noisy 3D DiT latent geometry (left) vs denoised PBR-textured hero asset (right) (glsl-fragment; rendered 2026-11-30)

```json
{
  "P_DENOISE": 0.76,
  "P_PBR_METAL": 0.65,
  "P_ROT_SPEED": 0.55,
  "P_SPLIT": 0.46
}
```

```glsl
const float P_DENOISE = 0.76; // P DiT Denoise [0.05, 1.0, 0.02]
const float P_PBR_METAL = 0.65; // P PBR Metallic [0.0, 1.0, 0.02]
const float P_ROT_SPEED = 0.55; // P Orbit Speed [0.0, 2.2, 0.05]
const float P_SPLIT = 0.46; // P Latent / PBR Split [0.0, 1.0, 0.02]

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

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

// Multi-resolution sculpted armored helmet/relic generated by CLAY DiT
float mapRelic(vec3 p, float spin, float noiseAmt) {
  vec3 q = p;
  q.xz = rot2(spin * 0.48) * q.xz;
  float dome = length(q * vec3(1.0, 0.85, 1.05)) - 0.56;
  float visor = sdBox(q - vec3(0.0, 0.06, 0.42), vec3(0.36, 0.11, 0.25)) - 0.04;
  float crest = sdBox(q - vec3(0.0, 0.54, 0.0), vec3(0.07, 0.24, 0.44)) - 0.03;
  float d = min(max(dome, -visor), crest);
  // Multi-resolution DiT denoising perturbation (vanishes as P_DENOISE -> 1)
  float n = sin(q.x * 13.0) * cos(q.y * 13.0) * sin(q.z * 13.0)
          + 0.5 * sin(q.x * 23.0 + q.z * 19.0);
  return (d + n * 0.085 * noiseAmt) * 0.78;
}

vec3 calcNormal(vec3 p, float spin, float noiseAmt) {
  vec2 e = vec2(0.0025, 0.0);
  return normalize(vec3(
    mapRelic(p + e.xyy, spin, noiseAmt) - mapRelic(p - e.xyy, spin, noiseAmt),
    mapRelic(p + e.yxy, spin, noiseAmt) - mapRelic(p - e.yxy, spin, noiseAmt),
    mapRelic(p + e.yyx, spin, noiseAmt) - mapRelic(p - e.yyx, spin, noiseAmt)
  ));
}

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 screenX = fragCoord.x / max(iResolution.x, 1.0);
  float split = clamp(P_SPLIT, 0.0, 1.0);
  bool isPBR = screenX >= split;
  float denoise = clamp(P_DENOISE, 0.0, 1.0);
  float metal = clamp(P_PBR_METAL, 0.0, 1.0);
  float spin = iTime * max(P_ROT_SPEED, 0.0);

  // Left shows coarse/noisy latent stage; right shows denoised PBR stage
  float noiseAmt = isPBR ? (1.0 - denoise) * 0.25 : (1.15 - 0.65 * denoise);

  vec3 ro = vec3(0.0, 0.10, 2.28);
  vec3 rd = normalize(vec3(uv, -1.52));
  vec3 col = mix(vec3(0.028, 0.032, 0.048), vec3(0.072, 0.082, 0.118), smoothstep(-0.55, 0.55, uv.y));

  float t = 0.0;
  bool hit = false;
  for (int i = 0; i < 56; i++) {
    float d = mapRelic(ro + rd * t, spin, noiseAmt);
    if (d < 0.0025) { hit = true; break; }
    t += d;
    if (t > 5.0) break;
  }

  if (hit) {
    vec3 p = ro + rd * t;
    vec3 n = calcNormal(p, spin, noiseAmt);
    vec3 objP = p;
    objP.xz = rot2(spin * 0.48) * objP.xz;

    vec3 l1 = normalize(vec3(0.60, 0.80, 0.55));
    vec3 l2 = normalize(vec3(-0.75, 0.15, 0.45));
    float diff1 = max(dot(n, l1), 0.0);
    float diff2 = max(dot(n, l2), 0.0);
    vec3 h1 = normalize(l1 - rd);
    float spec = pow(max(dot(n, h1), 0.0), isPBR ? 56.0 : 12.0);
    float fres = pow(1.0 - max(dot(n, -rd), 0.0), 4.0);

    if (!isPBR) {
      // Left: CLAY untextured clay-geometry latent + DiT token lattice lines
      vec3 clayCol = vec3(0.68, 0.65, 0.62) * (0.28 + 0.72 * diff1 + 0.22 * diff2);
      vec3 tokGrid = abs(fract(objP * 8.0) - 0.5);
      float tokLine = smoothstep(0.06, 0.015, min(tokGrid.x, min(tokGrid.y, tokGrid.z)));
      clayCol = mix(clayCol, vec3(0.28, 0.82, 0.98), tokLine * 0.42);
      col = clayCol + vec3(0.85) * spec * 0.18;
    } else {
      // Right: Stage-2 PBR material diffusion (anodized dark bronze + brushed gold crest + glowing visor)
      float isCrest = smoothstep(0.36, 0.48, objP.y) * smoothstep(0.16, 0.08, abs(objP.x));
      float isVisor = smoothstep(0.14, 0.08, abs(objP.y - 0.06)) * smoothstep(0.28, 0.36, objP.z);
      vec3 baseAlb = mix(vec3(0.24, 0.28, 0.36), vec3(0.92, 0.68, 0.26), isCrest);
      vec3 f0 = mix(vec3(0.04), baseAlb, metal);
      vec3 F = f0 + (1.0 - f0) * fres;
      vec3 envRef = mix(vec3(0.12, 0.22, 0.36), vec3(0.95, 0.85, 0.72), smoothstep(-0.3, 0.6, reflect(rd, n).y));
      col = baseAlb * (1.0 - metal * 0.65) * (0.24 + 0.78 * diff1 + 0.25 * diff2)
          + F * (envRef * 0.58 + vec3(1.0, 0.95, 0.88) * spec * 1.15);
      col = mix(col, vec3(0.18, 0.92, 1.0) * 1.45, isVisor);
    }
  }

  float sep = smoothstep(0.0035, 0.0008, abs(screenX - 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.

## Sources

1. [primary] Longwen Zhang, Ziyu Wang, Qixuan Zhang, Qiwei Qiu, Anqi Pang, Haoran Jiang, Wei Yang, Lan Xu, Jingyi Yu (2024) CLAY: A Controllable Large-scale Generative Model for Creating High-quality 3D Assets. ACM Transactions on Graphics. https://doi.org/10.1145/3658146 (verified via crossref on 2026-11-29)

## Cite this entry

Texel. "CLAY." https://texelatlas.vercel.app/t/clay/ (accessed 2026-12-01).
