shaders
FreeBodyEngine.graphics.pbr.shaders
#
FBUSL source for PBRPipeline's internal shaders - the lighting composite pass (deferred, reads the G-buffer back) and the light-list/PBR math it shares with default_forward.fbfrag (forward-shaded transparent objects - see graphics/material.py's BlendMode and PBRMaterial's shader defaults).
MAX_LIGHTS is a hard cap: every slot is a flat set of named uniforms
(LightN_...) rather than a true GLSL uniform array, unrolled MAX_LIGHTS
times in source. This is a deliberate, lower-risk choice over FBUSL's
@buffer blocks - see graphics/pbr/pipeline.py's module docstring for why.
Raising this constant costs one recompile of both shaders (see
graphics/pbr/pipeline.py, which reads it from here) and linearly more
uniform-set calls per frame; it is not a per-object cost.
Shadows: only slot 0 is ever sampled against a shadow map (see PBRPipeline._collect_lights - the shadow-casting DirectionalLight3D, if any, is always placed there). Every other slot is unshadowed. See graphics/pbr/lighting.py's module docstring for why 2D lights and non-slot-0 3D lights don't cast shadows yet.