MaterialX
An open standard (ASWF) for describing materials, procedural textures and look assignments as node graphs in XML, with code generators for GLSL, MSL, OSL and MDL. The lingua franca between DCCs and renderers.
In the family Materials, BRDFs & texturing, material interchange
Where it runs
Built inOfficial add-onPluginNone foundNot researched
| Engine | Support | How |
|---|---|---|
| three.js r187 | Official add-on | import { MaterialXLoader } from 'three/addons/loaders/MaterialXLoader.js' docs |
| Babylon.js 9.38.0 | None found | Babylon.js provides NodeMaterial and OpenPBRMaterial; MaterialX document import is not built in. |
| Godot 4.7 | None found | |
| Unity | None found | No MaterialX import or node set in Unity 6.3 Shader Graph. |
| Unreal 5.7 | Official add-on | Import .mtlx via Interchange (Project Settings > Interchange > MaterialX) docs |
| Blender 5.2 | Built in | File > Import/Export > Universal Scene Description (USD) with Hydra MaterialX shader graph translation docs |
| WebGPU W3C | None found | |
| Metal | None found |
How it works
A MaterialX document is an XML file of typed nodes (images, noise, math, color transforms, shading models) wired into graphs, plus 'looks' that bind materials to geometry and variants. The core library defines standard nodes and the standard_surface and OpenPBR shading nodes. Implementations are reference libraries (C++/Python/JavaScript) that read, validate and transform documents, and shader generators that flatten a graph into GLSL, ESSL, MSL, OSL or MDL source, so one asset can be rendered by USD-based viewers, DCC tools and web viewers. The JavaScript build runs in WebAssembly, powering browser viewers. The standard library also ships a node for OpenPBR Surface.
When to choose it
Reach for it when
- materials break when moving between tools
- need one portable shader graph across renderers
- usd pipeline needs renderer-neutral look development
- want to export material nodes to glsl, osl and mdl
Choose it for portable material graphs shared across tools, renderer-neutral look development and USD pipelines. Prefer plain glTF PBR for simple web delivery, and engine-native node graphs when you never leave one engine. Use it as the carrier format for OpenPBR Surface.
Field marks
- Generated shaders can be large and slow when graphs are deep, with little dead-node elimination
- Support for individual nodes differs between renderers, so the same graph renders differently
- Round-trip through DCC exporters loses non-standard nodes
- Only some node outputs have texture-baking support
Presets
MaterialX — live Standard Surface node graph (left) vs evaluated procedural shader ball (right)
{
"P_METALNESS": 0.55,
"P_CLEARCOAT": 0.75,
"P_VEIN_FREQ": 5.5,
"P_SPLIT": 0.46
}Show GLSL (246 lines)
const float P_METALNESS = 0.55; // P Metalness [0.0, 1.0, 0.05]
const float P_CLEARCOAT = 0.75; // P Clearcoat [0.0, 1.0, 0.05]
const float P_VEIN_FREQ = 5.50; // P Noise Frequency [2.0, 12.0, 0.5]
const float P_SPLIT = 0.46; // P Graph / Shader Split [0.0, 1.0, 0.02]
float hash31(vec3 p) {
p = fract(p * vec3(127.1, 311.7, 74.7));
p += dot(p, p.yzx + 19.19);
return fract((p.x + p.y) * p.z);
}
float noise3(vec3 p) {
vec3 i = floor(p);
vec3 f = fract(p);
f = f * f * (3.0 - 2.0 * f);
float n000 = hash31(i + vec3(0.0, 0.0, 0.0));
float n100 = hash31(i + vec3(1.0, 0.0, 0.0));
float n010 = hash31(i + vec3(0.0, 1.0, 0.0));
float n110 = hash31(i + vec3(1.0, 1.0, 0.0));
float n001 = hash31(i + vec3(0.0, 0.0, 1.0));
float n101 = hash31(i + vec3(1.0, 0.0, 1.0));
float n011 = hash31(i + vec3(0.0, 1.0, 1.0));
float n111 = hash31(i + vec3(1.0, 1.0, 1.0));
return mix(
mix(mix(n000, n100, f.x), mix(n010, n110, f.x), f.y),
mix(mix(n001, n101, f.x), mix(n011, n111, f.x), f.y),
f.z
);
}
float fbm3(vec3 p) {
float v = 0.0;
float a = 0.5;
for (int i = 0; i < 4; i++) {
v += a * noise3(p);
p *= 2.05;
a *= 0.5;
}
return v;
}
float sdRoundBox(vec2 p, vec2 b, float r) {
vec2 q = abs(p) - b + r;
return length(max(q, 0.0)) + min(max(q.x, q.y), 0.0) - r;
}
float sdBezierWire(vec2 p, vec2 a, vec2 b, out float tOut) {
float minD = 1e5;
tOut = 0.0;
vec2 c1 = vec2(mix(a.x, b.x, 0.55), a.y);
vec2 c2 = vec2(mix(a.x, b.x, 0.45), b.y);
vec2 prev = a;
for (int i = 1; i <= 16; i++) {
float t = float(i) / 16.0;
float u = 1.0 - t;
vec2 cur = u * u * u * a + 3.0 * u * u * t * c1 + 3.0 * u * t * t * c2 + t * t * t * b;
vec2 pa = p - prev, ba = cur - prev;
float h = clamp(dot(pa, ba) / max(dot(ba, ba), 1e-6), 0.0, 1.0);
float d = length(pa - ba * h);
if (d < minD) { minD = d; tOut = (float(i - 1) + h) / 16.0; }
prev = cur;
}
return minD;
}
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 evalStudioEnv(vec3 d) {
vec3 bg = mix(vec3(0.08, 0.10, 0.14), vec3(0.26, 0.34, 0.48), smoothstep(-0.3, 0.8, d.y));
float softbox = smoothstep(0.32, 0.12, abs(d.x - 0.35)) * smoothstep(0.25, 0.65, d.y);
float rim = exp(-abs(d.y - 0.12) * 14.0) * smoothstep(-0.3, 0.5, -d.x);
return bg + vec3(2.5, 2.3, 2.0) * softbox + vec3(0.55, 0.92, 1.35) * rim;
}
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 showBall = sx >= split;
float metal = clamp(P_METALNESS, 0.0, 1.0);
float coat = clamp(P_CLEARCOAT, 0.0, 1.0);
float vFreq = clamp(P_VEIN_FREQ, 1.5, 14.0);
vec3 col = vec3(0.04, 0.05, 0.07);
if (!showBall) {
// Left: MaterialX DAG node graph schematic with live animated procedural swatch previews
vec2 g = uv + vec2(0.36, 0.0);
// Subtle schematic grid
vec2 gr = abs(fract(g * 14.0) - 0.5);
float gridLine = smoothstep(0.04, 0.01, min(0.5 - gr.x, 0.5 - gr.y));
col = vec3(0.045, 0.055, 0.075) + vec3(0.04, 0.06, 0.09) * gridLine;
// Node centers in graph space
vec2 nNoise = vec2(-0.36, 0.22);
vec2 nRamp = vec2(-0.12, 0.28);
vec2 nRough = vec2(-0.12, -0.02);
vec2 nCoat = vec2(-0.12, -0.28);
vec2 nSurf = vec2(0.16, 0.04);
// Draw Bezier connections with animated signal pulses
vec2 starts[5];
vec2 ends[5];
vec3 wCols[5];
starts[0] = nNoise + vec2(0.09, 0.01); ends[0] = nRamp - vec2(0.09, 0.0); wCols[0] = vec3(0.35, 0.85, 1.0);
starts[1] = nNoise + vec2(0.09, -0.02); ends[1] = nRough - vec2(0.09, 0.0); wCols[1] = vec3(0.75, 0.80, 0.90);
starts[2] = nRamp + vec2(0.09, 0.0); ends[2] = nSurf - vec2(0.11, -0.09); wCols[2] = vec3(0.95, 0.65, 0.25);
starts[3] = nRough + vec2(0.09, 0.0); ends[3] = nSurf - vec2(0.11, 0.0); wCols[3] = vec3(0.55, 0.92, 0.65);
starts[4] = nCoat + vec2(0.09, 0.0); ends[4] = nSurf - vec2(0.11, 0.09); wCols[4] = vec3(0.85, 0.55, 1.0);
for (int i = 0; i < 5; i++) {
float wt = 0.0;
float dw = sdBezierWire(g, starts[i], ends[i], wt);
float line = smoothstep(0.0085, 0.003, dw);
float pulse = exp(-pow(fract(wt - iTime * 0.45 - float(i) * 0.17) - 0.5, 2.0) * 60.0);
col = mix(col, wCols[i] * (0.65 + 1.2 * pulse), line);
}
// Draw 5 MaterialX nodes with live procedural thumbnails inside each box
vec2 nPos[5];
vec2 nSz[5];
vec3 hdr[5];
nPos[0] = nNoise; nSz[0] = vec2(0.09, 0.09); hdr[0] = vec3(0.22, 0.56, 0.88);
nPos[1] = nRamp; nSz[1] = vec2(0.09, 0.085); hdr[1] = vec3(0.86, 0.48, 0.16);
nPos[2] = nRough; nSz[2] = vec2(0.09, 0.085); hdr[2] = vec3(0.22, 0.72, 0.46);
nPos[3] = nCoat; nSz[3] = vec2(0.09, 0.08); hdr[3] = vec3(0.68, 0.36, 0.88);
nPos[4] = nSurf; nSz[4] = vec2(0.11, 0.16); hdr[4] = vec3(0.92, 0.32, 0.24);
for (int i = 0; i < 5; i++) {
vec2 lp = g - nPos[i];
float d = sdRoundBox(lp, nSz[i], 0.015);
float fill = smoothstep(0.004, -0.004, d);
float border = smoothstep(0.006, 0.001, abs(d));
vec3 body = vec3(0.10, 0.12, 0.16);
// Header bar
if (lp.y > nSz[i].y - 0.032) body = hdr[i] * 0.85;
else {
vec2 suv = lp / max(nSz[i], vec2(0.01)) * 0.5 + 0.5;
float nv = fbm3(vec3(suv * vFreq * 0.65, iTime * 0.15));
float vein = smoothstep(0.32, 0.68, abs(sin(suv.x * vFreq + nv * 4.2)));
if (i == 0) body = vec3(nv);
else if (i == 1) body = mix(vec3(0.07, 0.16, 0.22), vec3(0.94, 0.68, 0.28), vein);
else if (i == 2) body = vec3(mix(0.15, 0.65, 1.0 - vein)) * vec3(0.85, 0.95, 0.90);
else if (i == 3) body = vec3(coat * 0.9, coat * 0.6, coat);
else {
// Standard Surface output preview sphere inside final node
float rr = length((lp + vec2(0.0, 0.015)) / 0.075);
if (rr < 1.0) {
vec3 sn = vec3((lp + vec2(0.0, 0.015)) / 0.075, sqrt(max(1.0 - rr * rr, 0.0)));
float nl = max(dot(sn, normalize(vec3(0.5, 0.7, 0.6))), 0.1);
vec3 baseC = mix(vec3(0.07, 0.16, 0.22), vec3(0.94, 0.68, 0.28), vein);
body = baseC * nl + vec3(0.9) * pow(max(dot(sn, normalize(vec3(0.35, 0.55, 0.8))), 0.0), 28.0) * (0.4 + 0.6 * coat);
}
}
}
col = mix(col, body, fill);
col = mix(col, hdr[i] * 1.15, border);
}
} else {
// Right: Evaluated MaterialX Standard Surface shader ball with rotating sculpted core
vec3 ro = vec3(0.18, 0.18, 2.25);
vec3 rd = normalize(vec3(uv - vec2(0.16, 0.0), -1.45));
col = evalStudioEnv(rd) * 0.36;
// Intersect shader ball sphere (R=0.58) and recessed studio plinth
vec3 sc = vec3(0.18, 0.02, 0.0);
vec3 oc = ro - sc;
float b = dot(oc, rd);
float c = dot(oc, oc) - 0.58 * 0.58;
float disc = b * b - c;
float tSph = (disc > 0.0 && (-b - sqrt(disc)) > 0.05) ? (-b - sqrt(disc)) : 1e5;
float tPl = (rd.y < -0.01) ? ((-0.58 - ro.y) / rd.y) : 1e5;
if (tPl < 0.05 || tPl > 12.0) tPl = 1e5;
float tHit = min(tSph, tPl);
if (tHit < 1e4) {
vec3 p = ro + rd * tHit;
vec3 v = -rd;
if (tSph < tPl) {
vec3 n = normalize(p - sc);
float a = iTime * 0.32;
mat3 ry = mat3(cos(a), 0.0, sin(a), 0.0, 1.0, 0.0, -sin(a), 0.0, cos(a));
vec3 objP = ry * (p - sc);
// Evaluate the exact MaterialX procedural graph: fbm3 -> marble/copper vein -> standard_surface inputs
float nVal = fbm3(objP * vFreq * 0.85);
float vein = smoothstep(0.28, 0.72, abs(sin(objP.x * vFreq + objP.y * 2.4 + nVal * 4.5)));
vec3 baseCol = mix(vec3(0.06, 0.16, 0.24), vec3(0.92, 0.64, 0.26), vein);
float rough = mix(0.42, 0.14, vein);
float met = mix(metal * 0.25, min(metal * 1.15, 1.0), vein);
// Micro-bump from graph derivative
vec3 eps = vec3(0.01, 0.0, 0.0);
float nx = fbm3((objP + eps.xyy) * vFreq * 0.85) - nVal;
float ny = fbm3((objP + eps.yxy) * vFreq * 0.85) - nVal;
vec3 bumpN = normalize(n - (transpose(ry) * vec3(nx, ny, 0.0)) * 2.2);
vec3 L = normalize(vec3(0.55, 0.76, 0.58));
vec3 H = normalize(L + v);
float ndl = max(dot(bumpN, L), 0.0);
float ndv = max(dot(bumpN, v), 0.005);
float ndh = max(dot(bumpN, H), 0.0);
float vdh = max(dot(v, H), 0.0);
vec3 f0 = mix(vec3(0.04), baseCol, met);
vec3 F = f0 + (1.0 - f0) * pow(1.0 - vdh, 5.0);
float D = D_GGX(ndh, max(rough * rough, 0.04));
vec3 spec = D * F / max(4.0 * ndv * max(ndl, 0.05), 0.08) * ndl * 1.4;
vec3 diff = (1.0 - F) * (1.0 - met) * baseCol * (ndl * 0.95 + 0.28);
vec3 envR = evalStudioEnv(reflect(-v, bumpN));
vec3 ibl = envR * (f0 + (1.0 - f0) * pow(1.0 - ndv, 5.0)) * mix(1.0, 0.28, rough);
col = diff + spec + ibl * 0.82;
// MaterialX clearcoat layer using geometric normal n
if (coat > 0.01) {
float ndhC = max(dot(n, H), 0.0);
float ndvC = max(dot(n, v), 0.005);
float Fc = 0.04 + 0.96 * pow(1.0 - ndvC, 5.0);
float Dc = D_GGX(ndhC, 0.05);
vec3 coatSpec = vec3(Dc * 0.04 / max(4.0 * ndvC, 0.1)) * max(dot(n, L), 0.0);
vec3 coatEnv = evalStudioEnv(reflect(-v, n)) * Fc;
col = col * (1.0 - coat * Fc * 0.55) + coat * (coatSpec * 0.55 + coatEnv * 0.85);
}
} else {
vec2 chk = floor((p.xz - vec2(0.18, 0.0)) * 3.5);
vec3 fl = mix(vec3(0.10, 0.12, 0.15), vec3(0.18, 0.20, 0.24), mod(chk.x + chk.y, 2.0));
float ao = smoothstep(0.25, 1.15, length(p.xz - sc.xz));
col = mix(fl * (0.35 + 0.65 * ao), evalStudioEnv(rd) * 0.36, 1.0 - exp(-tPl * 0.22));
}
}
}
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 |
|---|---|---|---|
| materialx-live | Tesla T4 1920x1080 | 61.0× baseline (extreme) · 2.01 ms / 2.07 ms | opengl-timer-query · 32 frames · GPU Weight Atlas · Colab T4 sweep |
| materialx-live | NVIDIA L4 1920x1080 | 58.2× baseline (heavy) · 0.925 ms / 0.930 ms · 2.2× faster on L4 | opengl-timer-query · Cross-architecture validation |
| materialx-live | NVIDIA A100-SXM4-40GB 1920x1080 | 42.9× baseline (heavy) · 1.24 ms / 1.24 ms · 1.6× faster on A100 | opengl-timer-query · Cross-architecture validation |
Lineage
Crosses
- 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.
Sources
- implementationAcademySoftwareFoundation (2017). AcademySoftwareFoundation/MaterialX. MaterialX is an open standard for the exchange of rich material and look-development content across applications and renderers.GitHub API · license Apache-2.0 · 2026-11-29