Update the camera-dependent uniforms.
_resolution and _isOrtho are accepted and IGNORED: the resolution exists so
a material can size a screen-space sprite, and a mesh's size is its own
geometry; the near fade's ortho test reads three's isOrthographic, i.e. the
camera this draw uses. Only nearCull is consumed. Named with a leading
underscore so the asymmetry is visible at the signature rather than buried in
the body.
OptionalnearCull: numberOptional_pixelRatio: numberCurrent opacity multiplier (the LOD cross-fade snapshots this as its fade base).
Update gamma. Toggles LUXAR_GAMMA_ONE across the 1.0 threshold so the
fragment pow() fast path recompiles in/out — mirrors the sibling materials.
Private_Mirrors PointMaterial._refreshNoGOGDefine — the flag depends on both values.
Wrapped-diffuse shade floor (1.0 = flat diffuse). Plain uniform write.
Wrapped-diffuse exponent. Plain uniform write.
opaque-mode cutout threshold. Plain uniform write — inert in every other
mode, where the coverage is applied by the framebuffer instead of compared.
Switch between the stored-normal, derivative-normal and unlit variants.
Called per commit by applyMeshShading, because the normal_dims == displayDims half of the §3.4 rule is view-dependent. Idempotent and guarded:
toggling a define recompiles the program, which must not happen on a slice
move that changed nothing.
'none' is NOT view-dependent — it is authored — but it flows through the
same setter so there is one place that owns the shading define set. A separate
setUnlit would let a per-commit updateShading('flat') silently clear it.
Swap the base-colour texture, maintaining the one-colour-source invariant.
A null texture falls back to whatever the other sources provide, which is why
this routes through the shared resolver rather than just deleting its own
define: dropping a texture from a node that also has a colormap LUT must
re-enable USE_COLORMAP, not leave the mesh with no colour source at all.
Apply a Luxar blending mode in place.
Single source of truth for creation-time wiring and runtime layers-panel transitions alike, exactly as in the sibling materials. Two mesh-specific points:
volumetric is mapped to opaque here as well as at load. The panel can
offer it (the dropdown is shared), and a mesh must not be left in a mode
whose fragment branch it does not implement.LUXAR_MESH_ALPHA_CUTOUT for opaque and
LUXAR_MAX_RGB_CONTRIBUTION for max. Each must be cleared when leaving its
mode — an opaque → additive switch that stranded the cutout would keep
discarding fragments in a mode that has no cutout.Returns a new material with copied values from this instance.
A clone of this instance.
Bind a colormap LUT texture (or null to disable colormap mode).
When texture is non-null, the USE_COLORMAP define is added
and the uniforms (uColormapTex, uScalarMin, uScalarScale)
are allocated with neutral defaults if they don't exist yet.
When texture is null, the define is removed and the uniform
values are cleared so a subsequent clone() doesn't resurrect
a stale colormap.
No-op when called on a material whose shader path doesn't
include USE_COLORMAP-guarded uniforms.
Update the scalar range [min, max] the colormap maps over.
Encoded as uScalarMin = min and uScalarScale = 1/max(1e-10, max-min)
for the shader. No-op when colormap mode is not active (uniforms
are absent until setColormapTexture has been called once).
Mesh surface material — shaded, indexed triangles.