DrawableShadow

Runs the cascaded shadow map depth pass for the directional sun-shadow pipeline. Enqueued each frame by earth.worldwind.layer.shadow.ShadowLayer in the BACKGROUND drawable group, so its draw runs before any receiver shape / terrain draw and the cascade depth textures are populated by the time receivers sample them (DrawContext.shadowCascadeFramebuffer).

The pass is depth-only: DirectionalDepthProgram rasterises casters through each cascade's orthographic light projection with colour writes masked off, and the cascade framebuffer's DEPTH_COMPONENT texture receives true hardware depth. That makes glPolygonOffset a real slope-scaled caster bias — steeply-lit triangles get proportionally more offset, so receivers only need a small constant bias and contact shadows survive at street scale.

Casters are dispatched via the ShadowCaster interface, parallel to SightlineOccluder but with this drawable's per-cascade matrices.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Switches the depth pass to the alpha-tested caster program for a cutout-textured sub-draw: binds texture on unit 0 and loads cutoff. The caller binds its own texcoord attribute (location 1) and calls endAlphaMaskedCaster afterwards. Returns false - leaving the opaque program active - when the variant is unavailable or the texture fails to bind (the sub-draw then casts a solid silhouette).

Link copied to clipboard
open override fun draw(dc: DrawContext)
Link copied to clipboard
fun drawShapeStateOccluder(dc: DrawContext, state: DrawShapeState, vertexStride: Int)

Renders a DrawShapeState's filled-triangle primitives into the active cascade. Mirrors DrawableSightline.drawShapeStateOccluder – the depth pass shader and matrix conventions are identical.

Link copied to clipboard

Restores the opaque depth program after an alpha-masked sub-draw.

Link copied to clipboard
fun loadCasterMatrix(modelMatrix: Matrix4)

Composes the active cascade's lightView * modelMatrix and loads it into the depth-pass program. Casters call this once before each draw call.

Link copied to clipboard

Convenience for casters whose vertex buffer is stored relative to a translated origin in world coordinates (the common case — terrain tiles, shape vertex origins).

Link copied to clipboard
open override fun recycle()