mx_power
MaterialX‑compatible power wrapper. Performs component‑wise exponentiation in1^in2. The exponent defaults to float(1) when omitted.
Core Advantages
Aligned with MaterialX naming and semantics, making mx_* graph migration straightforward. Equivalent to pow(in1, in2) but with a convenient default exponent for shaping curves.
Common Uses
Gamma/exposure‑like response curves
Nonlinear shaping of masks or distance falloff
Emphasizing or softening PBR parameters such as roughness or specular
Remapping noise or depth scalars
How to adjust
Tune the exponent in2: >1 compresses the head and brightens the tail; 0<in2<1 expands the head and softens transitions; =1 is identity. Works per‑component for vecN inputs. For stability clamp the base, e.g. max(in1, 1e-6) or clamp(in1, 0.0, 1.0), to avoid NaNs.
Code Examples
1// Shape a horizontal UV ramp and mix two colors
2const t = uv().x;
3const shaped = mx_power( t, float( 2.2 ) ); // exponent>1 darkens the head
4material.colorNode = mix( color( 0x0ea5e9 ), color( 0xf59e0b ), shaped );