Render Context
Properties
Mirrors earth.worldwind.draw.DrawContext.contextVersion for this frame. Renderables that own GPU handles outside RenderResourceCache can compare this against a cached value during doRender to detect a GL context teardown (e.g. Android pause / resume) and reset their stale references.
Frame snapshot of earth.worldwind.FogSse: camera fog density; 0 disables fog degradation.
Frame snapshot of earth.worldwind.FogSse.screenSpaceErrorFactor.
Distance beyond which a tile is fully fogged and may be culled from assembly.
Per-frame coverage sectors published by 3D-Tile mesh layers — terrain tiles outside every region skip the GROUND_COVERED_BIT stencil test so distant mountains still occlude mesh content via depth test.
Per-frame 3D-Tile mesh drawables registered for surface-shape draping. Propagated to DrawContext.groundOverlaySurfaces via earth.worldwind.frame.Frame.
Per-frame flag set by earth.worldwind.shape.RealtimeSightline.makeDrawable when a visible sightline is enqueued. Read by Ogc3dTilesProgram.get (and any other program that splices earth.worldwind.layer.sightline.SightlineReceiverGlsl) to pick the sightline-aware variant up front. Independent of DrawContext.sightlineState, which is populated later during the depth pass.
Set by earth.worldwind.layer.ogc3d.Ogc3dTilesLayer.doRender when a mesh layer is active this frame. Propagated to DrawContext.hasGroundCoverageMask via earth.worldwind.frame.Frame.
true when an enabled earth.worldwind.layer.shadow.ShadowLayer is present in layers for this frame. Computed once at the start of earth.worldwind.WorldWind.renderFrame before any Layer.render runs, so receivers that touch every visible fragment (surface tiles, atmosphere ground) can pick the smaller-binary no-shadow shader variant up-front. Independent of shadowState, which is populated later by earth.worldwind.layer.shadow.ShadowLayer.doRender.
true when the frame's earth.worldwind.layer.shadow.ShadowLayer has terrainLambert > 0. Gates per-tile terrain normal buffers in the tessellator, so shadow-only scenes (relief off) never pay the normals pipeline. Snapshotted alongside hasShadowLayer.
Wall-time nanos of the previous GL-thread frame (set by earth.worldwind.WorldWind.drawFrame). Generic GL-pressure signal for producers that emit GL-bound work and want to throttle when the GL thread ran long.
World-space (Cartesian) unit vector pointing toward the light source. Resolved by earth.worldwind.WorldWind each frame before any layer renders: the sun position when WorldWind.time is set, a custom WorldWind.lightDirectionProvider direction, or the surface normal at the camera's geographic position (a "light from above the user's foot point") as the default. Shape lighting, shadows and atmospheric scattering all read the same vector.
View-depth extent of shadow-relevant content accumulated while the previous regular frame's drawables were offered. Consumed by earth.worldwind.layer.shadow.ShadowLayer to fit cascade splits — the shadow layer renders before content layers, so the current frame's own accumulation (shadowSceneBoundsCurrent) is still empty at that point. One frame of latency is invisible in practice.
Accumulation target for the frame being rendered — rolled into shadowSceneBounds on reset.
Per-frame state for the directional sun-shadow pipeline. Non-null when a earth.worldwind.layer.shadow.ShadowLayer is in the layer list and has computed cascades for this frame; null otherwise. Snapshotted into earth.worldwind.frame.Frame at the end of render and propagated to earth.worldwind.draw.DrawContext.shadowState for the draw phase.
Bounds of sightlines registered this frame. Populated by Omni|DirectionalSightline.doRender, consulted by AbstractShape to keep off-camera shapes alive as occluders. Order matters: a shape's doRender only sees sightlines whose doRender has already run, so place sightlines earlier in layer order than the shapes they should shadow.
Mirrors earth.worldwind.util.kgl.Kgl.supportsSharedElementArrayBuffer for this frame's GL context — render-thread upload paths (no GL Kgl in reach) read it to decide whether index data shares the vertex buffer or needs its own EBO. See uploadMeshContent.
Scene time mirrored from earth.worldwind.WorldWind.time each frame, or null when no scene time is set. Drives every time-dependent feature: the sun-from-time lightDirection, the atmosphere day/night terminator and night texture, and star/sun positions in the star field.
Functions
Converts a geographic Position to Cartesian coordinates according to an altitudeMode. The Cartesian coordinate system is a function of this render context's current globe and its terrain surface, depending on the altitude mode. In general, it is not safe to cache the Cartesian coordinates, as many factors contribute to the value returned, and may change from one frame to the next.
Converts a geographic position to Cartesian coordinates according to an altitudeMode. The Cartesian coordinate system is a function of this render context's current globe and its terrain surface, depending on the altitude mode. In general, it is not safe to cache the Cartesian coordinates, as many factors contribute to the value returned, and may change from one frame to the next.
True when a shadow-casting bounding sphere outside the view frustum still intersects a valid cascade's light-space box - its shadow can reach visible ground. Requires the shadow layer to have rendered earlier in the layer list (shadowState set). Only the first ShadowState.offscreenCasterCascades cascades recruit (app-tunable via earth.worldwind.layer.shadow.ShadowLayer.offscreenCasterCascades): the coarse cascades' texels span metres, so an off-screen caster's shadow there is sub-texel noise, and their huge light boxes would keep distant content alive wholesale. Visible casters still draw into every cascade.
Queue a buffer upload when the cached BufferObject's version trails newVersion. onUploaded fires exactly once — async after the GL write, or sync here when no upload was queued. Pass nothing to skip; noinline is allocation-free at null.
Returns the height of a pixel at a given distance from the eye point. This method assumes the model of a screen composed of rectangular pixels, where pixel coordinates denote infinitely thin space between pixels. The units of the returned size are in meters per pixel.
The result of this method is undefined if the distance is negative.
Projects a Cartesian point to screen coordinates. The resultant screen point is in OpenGL screen coordinates, with the origin in the bottom-left corner and axes that extend up and to the right from the origin.
This stores the projected point in the result argument, and returns a boolean value indicating whether or not the projection is successful. This returns false if the Cartesian point is clipped by the near clipping plane or the far clipping plane.
Projects a Cartesian point to screen coordinates, applying an offset to the point's projected depth value. The resultant screen point is in OpenGL screen coordinates, with the origin in the bottom-left corner and axes that extend up and to the right from the origin.
This stores the projected point in the result argument, and returns a boolean value indicating whether or not the projection is successful. This returns false if the Cartesian point is clipped by the near clipping plane or the far clipping plane.
The depth offset may be any real number and is typically used to move the screenPoint slightly closer to the user's eye in order to give it visual priority over nearby objects or terrain. An offset of zero has no effect. An offset less than zero brings the screenPoint closer to the eye, while an offset greater than zero pushes the projected screen point away from the eye.
Applying a non-zero depth offset has no effect on whether the model point is clipped by this method or by WebGL. Clipping is performed on the original model point, ignoring the depth offset. The final depth value after applying the offset is clamped to the range 0,1.
Charges nanos of actual geometry assembly time against this frame's maxAssemblyTimeMillis budget.
Drops all shader programs, releasing each one's GL handles. Called after a GL context loss.