ShadingNodes ​Contract 2.0.0 · package sha256
a857eca95b35921109faf997094bb4192f12527d9d0fcd4be7e97f06425bad6e· generated fromconfigurator-runtime.d.tsbyservices/onsite-scripter/scripts/build-contract-docs.mjs; edit the source, not this file.
Interface · import type { ShadingNodes } from '@holostep-configurators/runtime-client/contract'; · labs, @experimental · since 2.0.0 · section 20. Labs
2.0's node set, by MaterialX 1.38's node and input names (stdlib_defs.mtlx): add, subtract,
multiply, divide, power, absval, clamp, min, max, mix, smoothstep, ifgreater,
normalize, dotproduct, crossproduct, extract, combine3 and image (mix takes fg,
bg and mix; multiply in1 and in2; smoothstep in, low and high; image file,
a 'texture' uniform, and texcoord, UV channel 0 when omitted), plus one Holostep node:
holo_simplexnoise3d, input position (vector3), output a float in about −1..1, today's GLSL
simplex noise (Ashima, as a live pergola's wood grain draws it). Any other node or input name, other
standard-library ones included, records 'unsupported-spec' naming it when the graph is built,
and materials wearing the graph keep their base fields. A 2.x minor adds
standard-library nodes as apps need them (spec section 3.2).
| Member | Kind | Summary |
|---|---|---|
uniform |
method | A graph input declared in uniforms; set it later with Shading.set. |
texcoord |
method | A UV channel. |
position |
method | The surface position. |
base |
method | The value the material's base fields feed gltf_pbr's input, the one an omitted ShadingOutputs key keeps: for 'baseColor', the factor × the slot's map sampled at its placement × the vertex colour (COLOR_0); for… |
node |
method | A node of the set above by its MaterialX name (e.g. 'mix', 'holo_simplexnoise3d'), with its inputs by their MaterialX names. |
export interface ShadingNodes<U extends Record<string, ShadingUniformType>> {
uniform<K extends keyof U & string>(name: K): ShadingNode<U[K]>;
texcoord(channel?: 0 | 1 | 2 | 3): ShadingNode<'vector2'>;
position(space?: 'object' | 'world'): ShadingNode<'vector3'>;
base<K extends 'baseColor' | 'roughness' | 'metallic'>(input: K): ShadingNode<K extends 'baseColor' ? 'color3' : 'float'>;
node<T extends ShadingUniformType>(name: string, inputs: Readonly<Record<string, ShadingNode | number | Point2 | Point3>>): ShadingNode<T>;
}
| Rule | Result |
|---|---|
| 1. Neutral name | pass: ShadingNodes names no product |
| 2. A precedent | pass: Babylon.js NodeMaterial (row K21); Blender shader nodes (row K21) |
| 3. Two apps, or labs | labs (@experimental at a stable path, reached through has() or supports()): it graduates when a second app uses it; apps today: app-510d750508, app-59c5b5751e |
| 4. The cheaper fix first | decided per need in Appendix B: rows K21 at tier labs (a member only where no rule, data, asset or app code serves the need) |