DrawableSightline

Renders the active sightline: a depth pass that rasterises the scene into the shared depth-only cube map (DrawContext.sightlineDepthCubeTexture) from the sightline's point of view, and an overlay pass that tints terrain visible/occluded by PCF-comparing each fragment against that cube (see earth.worldwind.layer.sightline.SightlineReceiverGlsl).

The cube always covers the full sphere; the sightline's heading/field-of-view wedge is a receiver-side mask (360 degrees masks nothing). All six faces are rendered — photogrammetry receivers above the observer (city-canyon facades) are tinted correctly, unlike the terrain-era assumption that nothing is visible looking up.

Types

Link copied to clipboard
object Companion
Link copied to clipboard

Properties

Link copied to clipboard

Local (Z = up) frame of the sightline position; cube faces render in this frame.

Link copied to clipboard

Depth-pass shader — the same trivial depth-only program the sun cascades use.

Link copied to clipboard

Horizontal wedge angle about heading; 360 degrees covers the full sphere.

Link copied to clipboard

Wedge heading clockwise from North. Irrelevant at 360 degrees.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Terrain overlay receiver shader; shares its GLSL with the embedded-receiver splice.

Link copied to clipboard
Link copied to clipboard

Selects which phases this drawable runs. The sightline shapes enqueue two drawables per frame: RenderMode.DEPTH_ONLY in BACKGROUND so the depth cube and DrawContext.sightlineState are populated before any embedded-receiver fragment shader runs (3D tiles need this), and RenderMode.OVERLAY_ONLY in SURFACE so terrain gets tinted after opaque receivers have rendered. RenderMode.DEPTH_AND_OVERLAY preserves the legacy single-drawable path for callers that don't split the work.

Link copied to clipboard

Identity of the sightline shape this drawable renders; twins of one shape share it.

Link copied to clipboard

Functions

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

Renders the filled-triangle primitives of a DrawShapeState into the sightline depth cube. Shared between DrawableShape (interleaved attributes, passes its own DrawShapeState.vertexStride) and DrawableMesh (positions packed tightly in their own buffer, stride 0). Line-mode primitives within an otherwise filled state are skipped, and the state's DrawShapeState.enableCullFace preference is respected.

Link copied to clipboard
fun loadOccluderMatrix(modelMatrix: Matrix4)

Composes the active face's matrices (cubeMapProjection × faceView × modelMatrix) and loads the result into the depth program's mvpMatrix uniform. SightlineOccluder implementations call this once before each draw call.

Link copied to clipboard

Convenience for occluders whose vertices are stored relative to a translated origin in world coordinates (the common case — terrain tiles, shape vertex origins, etc.).

Link copied to clipboard
open override fun recycle()