DrawableTileMesh

Color-pass drawable for one mesh tile. Pool-recycled. ShadowCaster + SightlineOccluder gate on shadowMode.castsShadows. The sightline visibility tint is applied per-fragment by Ogc3dTilesProgram's embedded SightlineReceiverGlsl splice; the SURFACE-grouped sightline overlay only tints terrain.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard

Set from Tile3d.isFallback at enqueue. Fallback tiles render only where stencil != stencilId so they fill gaps without overlaying finer descendants.

Link copied to clipboard

Tile kept alive only as a shadow caster (outside the view frustum): rasterizes in drawShadowDepth / drawSightlineDepth but skips the color pass entirely.

Link copied to clipboard
open override val overlayCenter: Vec3?

World bounding sphere center of this surface; null opts out of overlay drawing.

Link copied to clipboard
open override val overlayRadius: Double

World bounding sphere radius around overlayCenter.

Link copied to clipboard

Pick color for tile-level pick mode. Batch-level pick uses pickIdBase instead.

Link copied to clipboard

First pick id reserved for this tile's batches. Zero = tile-level pick.

Link copied to clipboard
Link copied to clipboard
open override val shadowCasterCenter: Vec3?

World-space bounding sphere center used to skip cascades whose AABB doesn't intersect this caster. Default null opts out of culling — the caster is dispatched into every cascade. Implementations populate this from their shape's boundingBox.center to gain per-cascade culling.

Link copied to clipboard
open override val shadowCasterRadius: Double

World-space bounding sphere radius. Only consulted when shadowCasterCenter is non-null.

Link copied to clipboard
Link copied to clipboard

Outermost-fallback subtree id (0 = no fallback ancestor → stencil bypassed; 1..255 = inside a fallback subtree). Non-fallback tiles write; fallback tiles draw where stencil != this id.

Link copied to clipboard

Combined VBO+EBO+batchIds buffer per submesh. Null entry → submesh draw skipped.

Link copied to clipboard

Resolved from RR cache at enqueue; null entries → submesh renders without texture. Pooled per instance — ensureSubmeshArrays grows in place to avoid per-frame arrayOfNulls<> allocations across ~hundreds of drawables.

Link copied to clipboard

Functions

Link copied to clipboard
open override fun draw(dc: DrawContext)
Link copied to clipboard
open override fun drawOverlay(dc: DrawContext, program: SurfaceOverlayProgram, uvMatrix: Matrix4)

Surface-shape overlay pass: re-rasterize the mesh with the draping program active so the terrain tile's shape texture paints the mesh surface. Triangles only; the caller owns depth-write and shared stencil state, this tile contributes only its stencilFunc.

Link copied to clipboard
open override fun drawShadowDepth(dc: DrawContext, shadow: DrawableShadow)

Cascade depth pass. Triangles only — lines/points alias on the shadow map.

Link copied to clipboard
open override fun drawSightlineDepth(dc: DrawContext, sightline: DrawableSightline)

Sightline depth pass. Triangles only — lines/points alias on the depth cube.

Link copied to clipboard

Resize the submesh arrays to hold at least n entries and null-clear the active range. Grows by power-of-two so consecutive enqueues for similar tile shapes avoid re-allocation.

Link copied to clipboard
open override fun recycle()
Link copied to clipboard
fun setWorldBounds(center: Vec3, radius: Double)

Populated by the layer before enqueue so the depth-pass can cull cheaply.