Face-culling mode used when a pass builds this material's render pipeline:
'back' (default) culls back faces, 'front' culls front faces, 'none'
draws both sides. A per-draw doubleSided flag (e.g. mixed-winding tile
content) forces 'none' regardless of this setting. Passes fold this into
their pipeline cache key, so it may differ between instances sharing a
shaderId.
ReadonlyshaderStable per-subclass identifier. All instances with the same shaderId
MUST produce identical getShaderCode output and identical
getBindGroupLayout layouts on a given device — the pass uses this
as the pipeline cache key.
Refractive transmission strength (glass). Default 0. Rendered by the forward TransmissionPass; not part of the forward/geometry uniform.
Volume thickness (Beer-Lambert). Default 0.
Beer-Lambert absorption color. Default [1,1,1].
Absorption distance. Default Infinity.
Chromatic dispersion. Default 0.
OptionaltransmissionPer-pixel transmission/thickness maps — read by the TransmissionPass, not part of this material's group-2 bind group.
OptionalthicknessPacked metallic / emissive-scalar / roughness map (engine MER convention:
R=metallic ×, G=emissive scalar, B=roughness ×). Matches PbrMaterial.merMap,
so a glTF metallic-roughness texture (swizzled to MER by the loader) transfers
directly. 1×1 (metallic 1, roughness 1) default when absent.
Returns the WGSL source for a given pass type and variant mask.
Which pass is asking.
Optional_variantMask: numberWGSL source.
Returns the bind group layout for slot MATERIAL_GROUP. Implementations
MUST cache the layout per device — typically with a static WeakMap<GPUDevice, ...>.
OptionalvariantMaskOverride: numberReturns the bind group instance for slot MATERIAL_GROUP. Implementations
may cache the bind group internally and recreate it lazily when textures or
other resource references change.
Optional: called by the pass once per draw before binding, so the material can flush any dirty CPU-side parameter changes into its uniform buffers.
Optional: release any GPU resources owned by this material instance (uniform buffers, owned textures). Bind group layouts shared across instances should NOT be destroyed here.
True for alpha-blended materials. ForwardPass routes these through its transparent sub-pass (after opaque) with depth-write disabled.