Texel A field guide to 3D techniques

BlenderAlchemy × MaterialX

Words to portable node materials. Describe a look in words, let a vision-language search edit a procedural node graph, and ship the winner as a MaterialX document that renders the same in DCCs, USD viewers, engines and the browser, instead of staying locked in Blender.

Open in StudioReproduced37.6× · 1.16 ms

BlenderAlchemyGeneration · Offlinein: text-prompt, ldr-image, graphout: graph, material-paramsmaterial-paramsMaterialXMaterial · Real-timein: material-params, textureout: material-params

Verified proof

reproduced · 2026-12-01texel-lablicense MIT
Specimen render of VLM-edited portable MaterialX (left: raw unedited copper fallback, right: portable OpenPBR hammered verdigris graph)
Cross-proof specimen. VLM-edited portable MaterialX (left: raw unedited copper fallback, right: portable OpenPBR hammered verdigris graph). Verified WebGL2 proof · 2026-12-01

Split-screen WebGL2 proof comparing an unedited / non-portable raw metallic shader ball (left, losing procedural crevices and multi-layer coat when exported out of a proprietary DCC) against a VLM-refined portable MaterialX OpenPBR node graph combining hammered copper facets, curvature-driven verdigris patina, spatially modulated GGX roughness, and satin clearcoat (right).

Chromium Headless ANGLE/SwiftShader WebGL2 · 512x512 · expresses a VLM-refined multi-layer hammered patinated copper look strictly within portable OpenPBR and standard MaterialX pattern nodes

Show GLSL proof (194 lines)
const float P_PATINA_AMT = 0.68; // P Verdigris Crevice Patina [0.0, 1.0, 0.02]
const float P_HAMMER_DEPTH = 0.82; // P Hammered Dimple Depth [0.0, 1.5, 0.05]
const float P_CLEARCOAT = 0.72; // P OpenPBR Clearcoat Weight [0.0, 1.0, 0.05]
const float P_ROUGH_CONTRAST = 0.85; // P Roughness Ramp Contrast [0.1, 1.5, 0.05]

vec3 hash33(vec3 p) {
  p = fract(p * vec3(0.1031, 0.1030, 0.0973));
  p += dot(p, p.yxz + 33.33);
  return fract((p.xxy + p.yxx) * p.zyx);
}

float vnoise3(vec3 p) {
  vec3 i = floor(p);
  vec3 f = fract(p);
  vec3 u = f * f * (3.0 - 2.0 * f);
  float n000 = hash33(i + vec3(0.0, 0.0, 0.0)).x;
  float n100 = hash33(i + vec3(1.0, 0.0, 0.0)).x;
  float n010 = hash33(i + vec3(0.0, 1.0, 0.0)).x;
  float n110 = hash33(i + vec3(1.0, 1.0, 0.0)).x;
  float n001 = hash33(i + vec3(0.0, 0.0, 1.0)).x;
  float n101 = hash33(i + vec3(1.0, 0.0, 1.0)).x;
  float n011 = hash33(i + vec3(0.0, 1.0, 1.0)).x;
  float n111 = hash33(i + vec3(1.0, 1.0, 1.0)).x;
  return mix(
    mix(mix(n000, n100, u.x), mix(n010, n110, u.x), u.y),
    mix(mix(n001, n101, u.x), mix(n011, n111, u.x), u.y),
    u.z
  );
}

// Portable MaterialX Worley/Voronoi cellular node for hammered copper dimples
float cellularHammer(vec3 p) {
  vec3 i = floor(p);
  vec3 f = fract(p);
  float d1 = 8.0;
  for (int z = -1; z <= 1; z++) {
    for (int y = -1; y <= 1; y++) {
      for (int x = -1; x <= 1; x++) {
        vec3 nb = vec3(float(x), float(y), float(z));
        vec3 pt = nb + 0.15 + 0.70 * hash33(i + nb);
        float d = length(f - pt);
        d1 = min(d1, d);
      }
    }
  }
  return clamp(d1, 0.0, 1.0);
}

// Sculpted studio shader ball with equatorial lathe grooves
float sdShaderBall(vec3 p) {
  float sph = length(p) - 0.82;
  // Two machined equatorial cavity bands that collect verdigris patina
  float groove1 = abs(p.y - 0.24) - 0.055;
  float groove2 = abs(p.y + 0.24) - 0.055;
  float cut = min(max(length(p) - 0.85, -max(-groove1, length(p) - 0.74)),
                  max(length(p) - 0.85, -max(-groove2, length(p) - 0.74)));
  float d = max(sph, -min(max(groove1, 0.75 - length(p)), max(groove2, 0.75 - length(p))));
  return min(d, max(sph + 0.06, cut));
}

vec3 calcBallN(vec3 p) {
  float e = 0.0025;
  return normalize(vec3(
    sdShaderBall(p + vec3(e, 0.0, 0.0)) - sdShaderBall(p - vec3(e, 0.0, 0.0)),
    sdShaderBall(p + vec3(0.0, e, 0.0)) - sdShaderBall(p - vec3(0.0, e, 0.0)),
    sdShaderBall(p + vec3(0.0, 0.0, e)) - sdShaderBall(p - vec3(0.0, 0.0, e))
  ));
}

vec3 studioIBL(vec3 rd) {
  float elev = clamp(rd.y * 0.5 + 0.5, 0.0, 1.0);
  vec3 grad = mix(vec3(0.06, 0.07, 0.09), vec3(0.22, 0.26, 0.34), pow(elev, 1.2));
  float sb1 = smoothstep(0.76, 0.94, dot(rd, normalize(vec3(0.55, 0.68, 0.48))));
  float sb2 = smoothstep(0.80, 0.96, dot(rd, normalize(vec3(-0.72, 0.36, 0.58))));
  float rim = smoothstep(0.10, 0.0, abs(rd.y - 0.08)) * 0.45;
  return grad + vec3(2.8, 2.55, 2.25) * sb1 + vec3(0.75, 1.18, 1.75) * sb2 + vec3(0.65) * rim;
}

float D_GGX(float ndh, float r) {
  float a = max(r * r, 0.002);
  float a2 = a * a;
  float d = ndh * ndh * (a2 - 1.0) + 1.0;
  return a2 / max(3.14159265 * d * d, 1e-5);
}

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 useMtlx = uv.x > 0.0;
  vec2 suv = vec2(useMtlx ? (uv.x - 0.25) : (uv.x + 0.25), uv.y);
  suv.x *= 1.85;

  float rot = iTime * 0.35;
  mat2 rotY = mat2(cos(rot), -sin(rot), sin(rot), cos(rot));
  vec3 ro = vec3(0.0, 0.12, 2.38);
  vec3 rd = normalize(vec3(suv.x * 0.72, suv.y - 0.05, -1.45));

  // Clean dark studio sweep backdrop
  vec3 col = mix(vec3(0.04, 0.045, 0.06), vec3(0.11, 0.12, 0.16), clamp(uv.y + 0.55, 0.0, 1.0));
  if (rd.y < -0.01) {
    float tf = (-0.86 - ro.y) / rd.y;
    if (tf > 0.0 && tf < 14.0) {
      vec3 fp = ro + rd * tf;
      float r2 = dot(fp.xz, fp.xz);
      float shad = 1.0 - 0.78 * exp(-r2 * 1.9);
      col = vec3(0.14, 0.15, 0.18) * shad * exp(-r2 * 0.18);
    }
  }

  float t = 0.0;
  for (int i = 0; i < 64; i++) {
    vec3 p = ro + rd * t;
    float d = sdShaderBall(p);
    if (d < 0.002 || t > 6.0) break;
    t += d * 0.85;
  }

  vec3 L1 = normalize(vec3(0.55, 0.72, 0.55));
  vec3 L2 = normalize(vec3(-0.70, 0.35, 0.62));
  if (t < 5.8) {
    vec3 wp = ro + rd * t;
    vec3 N = calcBallN(wp);
    vec3 V = -rd;
    vec3 objP = wp;
    objP.xz = rotY * objP.xz;

    if (!useMtlx) {
      // Left: unedited / dropped-node raw copper fallback (uniform roughness, no patina, no hammer facets)
      vec3 copper = vec3(0.86, 0.46, 0.30);
      float rough = 0.38;
      vec3 R = reflect(-V, N);
      float ndv = max(dot(N, V), 0.04);
      vec3 F = copper + (1.0 - copper) * pow(1.0 - ndv, 5.0);
      vec3 H1 = normalize(L1 + V);
      float spec1 = D_GGX(max(dot(N, H1), 0.0), rough) * 0.25;
      col = studioIBL(R) * F * 0.72 + copper * spec1 * vec3(2.2, 2.0, 1.8);
    } else {
      // Right: VLM-edited portable MaterialX OpenPBR graph
      // 1) Hammered Worley bump perturbation
      float e = 0.015;
      vec3 sp = objP * 6.5;
      float c0 = cellularHammer(sp);
      vec3 bumpG = vec3(
        cellularHammer(sp + vec3(e, 0.0, 0.0)) - c0,
        cellularHammer(sp + vec3(0.0, e, 0.0)) - c0,
        cellularHammer(sp + vec3(0.0, 0.0, e)) - c0
      ) / e;
      // Project bump gradient into tangent plane
      vec3 worldG = bumpG;
      worldG.xz = mat2(cos(rot), sin(rot), -sin(rot), cos(rot)) * worldG.xz;
      vec3 surfN = normalize(N - (worldG - N * dot(worldG, N)) * 0.14 * P_HAMMER_DEPTH);

      // 2) Curvature & cavity mask (lathe grooves + hammer dimple valleys) -> verdigris oxidation
      float grooveCavity = smoothstep(0.81, 0.75, length(wp));
      float noisePat = vnoise3(objP * 5.2) * 0.65 + vnoise3(objP * 14.0) * 0.35;
      float patinaMask = clamp((grooveCavity * 0.95 + (1.0 - c0) * 0.32 + (noisePat - 0.35) * 0.75) * P_PATINA_AMT, 0.0, 1.0);
      patinaMask = smoothstep(0.24, 0.72, patinaMask);

      // 3) OpenPBR spatially varying metalness, albedo & roughness ramps
      vec3 copperAlb = mix(vec3(0.74, 0.34, 0.18), vec3(0.95, 0.58, 0.38), smoothstep(0.15, 0.85, c0));
      vec3 verdigrisAlb = mix(vec3(0.14, 0.44, 0.38), vec3(0.32, 0.64, 0.54), noisePat);
      float metallic = 1.0 - patinaMask * 0.92;
      float rough = clamp(mix(0.16, 0.74, patinaMask) + (0.5 - c0) * 0.22 * P_ROUGH_CONTRAST, 0.08, 0.88);

      float ndv = max(dot(surfN, V), 0.04);
      vec3 F0 = mix(vec3(0.04), copperAlb, metallic);
      vec3 F = F0 + (1.0 - F0) * pow(1.0 - ndv, 5.0);
      vec3 R = reflect(-V, surfN);
      vec3 env = studioIBL(R) * mix(1.0, 0.38, rough);

      vec3 H1 = normalize(L1 + V);
      vec3 H2 = normalize(L2 + V);
      float ndl1 = max(dot(surfN, L1), 0.0);
      float ndl2 = max(dot(surfN, L2), 0.0);
      vec3 diff = (1.0 - metallic) * verdigrisAlb * (vec3(1.25, 1.15, 1.02) * ndl1 + vec3(0.45, 0.58, 0.78) * ndl2 + vec3(0.16));
      vec3 spec = F * (D_GGX(max(dot(surfN, H1), 0.0), rough) * vec3(2.4, 2.15, 1.9) * ndl1
                     + D_GGX(max(dot(surfN, H2), 0.0), rough) * vec3(0.75, 1.15, 1.65) * ndl2) * 0.28 + env * F * (0.85 - 0.45 * rough);

      // 4) OpenPBR dielectric satin clearcoat layer over metal + patina
      float coatF = (0.04 + 0.96 * pow(1.0 - max(dot(N, V), 0.04), 5.0)) * P_CLEARCOAT;
      float coatSpec = D_GGX(max(dot(N, H1), 0.0), 0.09) * ndl1 * 0.18 * P_CLEARCOAT;
      vec3 coatRefl = studioIBL(reflect(-V, N)) * coatF * 0.55 + vec3(1.0) * coatSpec;

      col = (diff + spec) * (1.0 - 0.35 * coatF) + coatRefl;
    }
  }

  col = acesTone(col * 1.08);
  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

BlenderAlchemy takes a text prompt, reference images and a starting node graph, and outputs an edited graph and material-params after a generate-and-evaluate search. MaterialX consumes material-params and textures and outputs a portable material description with shader generators for GLSL, MSL, OSL and MDL. The cross works only if the search stays inside the subset of nodes MaterialX can express, ideally the OpenPBR Surface node plus standard pattern nodes, so every candidate the evaluator scores is exportable.

How to build it

Fork BlenderAlchemy's edit generator so its action space is limited to nodes with MaterialX equivalents (noise, ramps, math, image textures, OpenPBR or Principled BSDF). After each edit, export through Blender's MaterialX path or a small graph translator, and render the candidate with the MaterialX viewer or a three.js MaterialX loader, so the vision model scores the renderer you will actually ship on. Keep the top candidates as .mtlx files with the prompt and score in metadata. Validate by rendering the same file in two other renderers and comparing.

Field marks

  1. Some Blender nodes have no MaterialX counterpart and drop silently on export.
  2. Renderers interpret the same graph slightly differently.
  3. The vision evaluator approves plausible but off-target looks.
  4. Search cost grows quickly with graph size.

Prior art

No prior art found on 2026-11-29.

Searches run (4)
  • arXiv: all:"MaterialX" AND all:"language model" → 0 results
  • GitHub repos: MaterialX "language model" → 0 results
  • arXiv: all:"procedural material" AND all:"vision language model" AND all:"node graph" → 1 result
  • GitHub repos: "procedural material" "vision language model" "node graph" → 0 results