Triangle Shader Program
Triangle / line strip program. A single GLSL source carries both the no-shadow (default) and shadow-aware paths, gated by a #define SHADOWS_ENABLED preprocessor symbol that shadowsEnabled toggles. Default TriangleShaderProgram() is the smaller-binary no-shadow variant; TriangleShaderProgramShadow - selected by get when an earth.worldwind.layer.shadow.ShadowLayer is in the layer list - flips the #define on.
Inheritors
Properties
Indicates the approximate size of the OpenGL resources referenced by this GPU program.
Frame stamp of the last ShadowState whose uniforms were uploaded into this program. GL uniforms are program-state and persist across draw calls, so once a program has been loaded with the current frame's cascades it doesn't need to be loaded again until the cascades change. Implementations declare this as a plain var field, default -1L.
Functions
Upload a unit-length world-space sun direction. Dirty-checked so identical directions across many draws (the typical case for one frame) skip the GL call.
Loads the model -> world transform. Used by the shadow receiver to reconstruct world position for shadow-map sampling. Dirty-checked, since shapes commonly issue several draws against the same world transform (line + fill, multi-segment paths).
Disables shadow sampling. Receivers' fragments fall through to a fixed 1.0 visibility.
Enables shadow sampling and uploads the cascade matrices, split depths, texel sizes, light direction and fade distance from state. Cascade sampler bindings (GL_TEXTURE1..4) are baked in at program init time; the caller is responsible for binding the matching cascade depth textures to those units before invoking this method — applyShadowReceiverUniforms does both in lockstep.
Forwards to ShadowReceiverUniforms.loadTerrainRelief; callers must reset to 0 after a relief draw so regular shape draws stay unshaded. No-op on the no-shadow variant.
Upload the unit world-space globe-radial up at the camera (hemispheric ambient).
Frees any resources associated with this instance. After this method returns the rendering resource is invalid, and any associated GL object is deleted.