Package-level declarations

Types

Link copied to clipboard

Represents an OpenGL shading language (GLSL) shader program and provides methods for identifying and accessing shader variables. Shader programs are configured by calling setProgramSources to specify the GLSL vertex shader and fragment shader source code, then made current by calling useProgram.

Link copied to clipboard

Alpha-tested variant of DirectionalDepthProgram for cutout-textured casters (tree billboards, fences, alpha-masked 3D-Tile submeshes): samples the caster's base-colour texture on unit 0 and discards fragments below the cutoff, so the cascade maps carry the cutout silhouette instead of the full quad. Kept separate from the opaque program - a discard-capable shader disables early depth optimisations, which opaque casters keep.

Link copied to clipboard

Lit / unlit textured-mesh 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 BasicTextureProgram() is the smaller-binary no-shadow variant; BasicTextureProgramShadow - selected by get when an earth.worldwind.layer.shadow.ShadowLayer is in the layer list - flips the #define on.

Link copied to clipboard

Sentinel subclass: distinct cache key for the shadow-aware GLSL variant. See BasicTextureProgram.

Link copied to clipboard

Common surface of the sightline depth casters: DirectionalDepthProgram writes true hardware depth (hardware depth-compare platforms), PackedDepthProgram packs depth into an RGBA8 color target (software-compare fallback). earth.worldwind.draw.DrawableSightline picks one per pass via earth.worldwind.draw.DrawContext.sightlineUsesPackedDepth.

Link copied to clipboard

Packs a 24-bit normalized depth-buffer value into the red, green and blue channels of an RGBA8 color attachment so it can be retrieved with glReadPixels(GL_RGBA, GL_UNSIGNED_BYTE). WebGL1 / GLES2 do not allow reading depth-component textures with glReadPixels, so the engine renders the pick-pass depth texture through this program onto a colour attachment, then unpacks the bytes on the CPU.

Link copied to clipboard

Depth-only caster program for the cascaded sun-shadow pipeline. Rasterises caster geometry through each cascade's orthographic light projection; the cascade framebuffer's DEPTH_COMPONENT texture receives the hardware depth value, which receivers later sample and compare directly. There is no meaningful colour output — the caller masks colour writes off for the whole pass.

Link copied to clipboard

Engine-wide lighting model shared by every lit fragment shader: albedo * (hemisphericAmbient + sceneDiffuse * lambert * sunVisibility).

Link copied to clipboard

Depth caster that packs the fragment's window depth into the RGB channels of an RGBA8 color target (red = high byte, green = middle, blue = low). Used by the sightline depth pass on platforms without hardware depth-compare samplers (earth.worldwind.util.kgl.Kgl.hasShadowSamplers): there receivers read the cube through a plain samplerCube, and sampling a real DEPTH_COMPONENT texture that way is driver-dependent — Adreno 512 returns ~8-bit quantized depth, which collapses the sightline's 1/d depth mapping into kilometre-scale buckets and classified entire scenes occluded (worked at 2.0.5's moment-map color cube, broke at 2.0.6's depth cube). RGBA8 color reads are exact on every GPU. Packing mirrors DepthToColorProgram / DrawContext.readPixelDepth: depth = r + g/255 + b/255^2 on normalized channels.

Link copied to clipboard

Depth-only program for camera-perspective offscreen prepasses (e.g. the Gaussian-splat pass's terrain occlusion depth). Unlike DirectionalDepthProgram there is no caster pancaking: under a perspective projection, geometry in front of the near plane must clip exactly as the main color pass clips it — pancaking it onto the near plane would write bogus near depth into the prepass target and wrongly occlude everything behind it.

Link copied to clipboard

Terrain overlay pass of the sightline: re-rasterises the visible terrain tiles and outputs the visible/occluded tint from SightlineReceiverGlsl's depth-cube PCF — the same receiver GLSL that embedded receivers (3D tiles) splice into their own programs, so the overlay and embedded tints resolve identically. Vertices arrive tile-origin-relative; the per-tile sightlineLocalMatrix is loaded via loadSightlineLocalMatrix.

Link copied to clipboard

Surface-projection shader that drapes a source image onto terrain via a 4x4 camera-frustum matrix in WGS84 ECEF, evaluated per fragment. Companion to SurfaceQuadShaderProgram (the 2D-homography path); used by the 3D path on earth.worldwind.shape.ProjectedMediaSurface when the shape carries an imageProjection matrix.

Link copied to clipboard

OES external-texture variant of Surface3DProjectionShaderProgram used when the source texture has target = GL_TEXTURE_EXTERNAL_OES (Android MediaPlayer -> SurfaceTexture path). Identical 3D camera-frustum projection shader; only the fragment-stage sampler type changes:

Link copied to clipboard

Drapes a terrain tile's surface-shape texture onto arbitrary ground geometry (3D-Tile meshes). The vertex shader carries the position through a world→UV matrix composed in double precision on the CPU; the fragment shader samples the tile texture and discards fragments outside the tile sector.

Link copied to clipboard

Surface-quad fragment shader that maps any planar quadrilateral footprint to a unit-square image space via a 2D homography (3x3 perspective transform). The homography is the inverse of the perspective projection a planar source image has on a planar ground patch, and is uniquely determined by the four corner correspondences. For rectangular footprints the homography reduces to an affine transform, identical to bilinear interpolation, so axis-aligned earth.worldwind.shape.ProjectedMediaSurface usages don't change. For trapezoidal footprints (as produced by a tilted drone gimbal) the homography is the mathematically correct interior interpolation; bilinear gives a different, incorrect result that diverges from a true perspective the further you stray from the corners.

Link copied to clipboard

OES external-texture variant of SurfaceQuadShaderProgram used when the interior texture has target = GL_TEXTURE_EXTERNAL_OES (typically a SurfaceTexture on Android driven by MediaPlayer / MediaCodec / Camera2). Identical homography surface-quad shader; only the fragment-stage sampler type changes:

Link copied to clipboard

Surface tile / surface texture program. Composites up to TEXTURE_UNITS imagery textures over a terrain tile in a single geometry pass: the fragment shader transforms the tile-local texture coordinate per attached texture (scale + translation), masks fragments outside each texture's sub-rectangle and blends the stack front-to-back in-shader. Terrain geometry is therefore drawn once per batch of textures instead of once per texture.

Link copied to clipboard

Sentinel subclass: distinct cache key for the shadow-aware GLSL variant of SurfaceTextureProgram. No GLSL or method overrides of its own - the parent's GLSL is the single source of truth, the #define SHADOWS_ENABLED flipped on by the constructor argument selects the shadow-aware compilation.

Link copied to clipboard

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.

Link copied to clipboard

Sentinel subclass: distinct cache key for the shadow-aware GLSL variant. See TriangleShaderProgram.

Link copied to clipboard

GPU kernel shader for earth.worldwind.shape.ViewshedSightline. Renders a fullscreen triangle over an N×N off-screen FBO; each fragment performs an Amanatides–Woo grid traversal from the observer to its own target cell, sampling elevations from an R32F texture and writing RGBA8 visible / occluded / transparent. The result is read back to CPU and projected via earth.worldwind.shape.SurfaceImage.