Documentation
    Preparing search index...

    Variable HEMISPHERE_IRRADIANCE_WGSLConst

    HEMISPHERE_IRRADIANCE_WGSL: "fn hemisphereIrradiance(n : vec3<f32>) -> vec3<f32> {\n let w = clamp(0.5 * dot(n, lights.hemisphereUp.xyz) + 0.5, 0.0, 1.0);\n return mix(lights.hemisphereGround.xyz, lights.hemisphereSky.xyz, w);\n}\n\nfn hemisphereAmbient(normalLength : f32, n : vec3<f32>) -> vec3<f32> {\n if (normalLength > 0.0) {\n return hemisphereIrradiance(n);\n }\n return mix(lights.hemisphereGround.xyz, lights.hemisphereSky.xyz, 0.5);\n}"

    The hemisphere mix both shaded fragment stages share — the WGSL port of gl-program.ts's HEMISPHERE_LIGHT_GLSL. Branch-free: a frame with no hemisphere writes zeros for sky and ground, so the mix is the zero vector regardless of n. A zero-length normal uses the 0.5 mix (constant extra ambient), matching the GL chunk.