The standard WGSL module for one variant quadruple — the lit family's
(normals, map, WP-R1.7's shadow) plus §59's packed metallic-roughness
map. metalRoughness defaults false so every landed scalar-only module is
byte-identical. The vertex stage is the lit family's, over this module's
own uniform block, and writes uvs when either texture is sampled; both
structs carry normalMatrix at the same offset so the shared vertex stage
reads draw.normalMatrix unchanged.
The fragment stage is STANDARD_FRAGMENT_SHADER_SOURCE's arithmetic in its
order: the base sample, the diffuse/F0 split, ambient into the diffuse lobe,
then — under the normal-length guard — the shared directLobe evaluated
once for the directional light and once per punctual light, each multiplied
by its irradiance and cosine at the call site, exactly as the GL refactor
keeps the directional term the pre-R-17 expression. Emissive is added last,
outside every guard, so a normal-less or back-facing surface still glows.
The standard WGSL module for one variant quadruple — the lit family's (
normals,map, WP-R1.7'sshadow) plus §59's packed metallic-roughness map.metalRoughnessdefaults false so every landed scalar-only module is byte-identical. The vertex stage is the lit family's, over this module's own uniform block, and writes uvs when either texture is sampled; both structs carrynormalMatrixat the same offset so the shared vertex stage readsdraw.normalMatrixunchanged.The fragment stage is
STANDARD_FRAGMENT_SHADER_SOURCE's arithmetic in its order: the base sample, the diffuse/F0 split, ambient into the diffuse lobe, then — under the normal-length guard — the shareddirectLobeevaluated once for the directional light and once per punctual light, each multiplied by its irradiance and cosine at the call site, exactly as the GL refactor keeps the directional term the pre-R-17 expression. Emissive is added last, outside every guard, so a normal-less or back-facing surface still glows.