Returns a THREE.ShaderMaterial under WebGL2 and a
NodeMaterial under WebGPU. Throws if the active backend's
source is missing — does not silently fall through to the
other backend (under WebGPU, ShaderMaterial would not render at
all; under WebGL2, a TSL NodeMaterial wouldn't dispatch).
The config's render state (blending, depthTest, depthWrite,
transparent, toneMapped, side) is applied on BOTH branches and
wins over anything a TSL factory set on itself; omitted fields take
the same resolved defaults either way. defines is WebGL-only. See
the module docblock for the limits on that agreement, and for the
blending states this helper cannot express at all.
Build a
THREE.Materialfor the active backend.Returns a
THREE.ShaderMaterialunder WebGL2 and aNodeMaterialunder WebGPU. Throws if the active backend's source is missing — does not silently fall through to the other backend (under WebGPU,ShaderMaterialwould not render at all; under WebGL2, a TSLNodeMaterialwouldn't dispatch).The config's render state (
blending,depthTest,depthWrite,transparent,toneMapped,side) is applied on BOTH branches and wins over anything a TSL factory set on itself; omitted fields take the same resolved defaults either way.definesis WebGL-only. See the module docblock for the limits on that agreement, and for the blending states this helper cannot express at all.