Documentation
    Preparing search index...

    Function litShaderSource

    • The lit WGSL module for one variant triple.

      Generated rather than stored, unlitShaderSource's rule: the shared half is written once and the text is a pure function of the flags, so the pipeline cache keys on the descriptor. The fragment stage is the GL lit stage's arithmetic in its order — normalize under the zero-length guard, base colour times the optional sample, the directional term, then the punctual loop added to the pre-existing expression — so a variant that samples nothing under a scene with no punctual lights computes exactly what the GL program computes with its switches at their initial values.

      shadow (WP-R1.7) swaps the light block for wgpu-shadow.ts's widened twin, splices shadowFactor, and multiplies the directional product before it joins the lighting sum — GL's useShadow branch, as a variant; the module header carries the argument. With it false — the default — the fragment arithmetic is the WP-R1.5 expression; the vertex stage reads draw.normalMatrix rather than the per-vertex cofactor that packet used.

      Parameters

      • normals: boolean
      • map: boolean
      • Optionalshadow: boolean

      Returns string