Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...
    • Build a THREE.Material for the active backend.

      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.

      Parameters

      Returns Material