Companion

object Companion

Properties

Link copied to clipboard
const val MSAA_SAMPLES: Int = 4

Sample count for the multisample framebuffer. 4× MSAA is broadly supported across desktop GL 3+ and OpenGL ES 3.0+ (Android API 18+). Effective sample count is clamped to GL_MAX_SAMPLES at FBO creation time inside the GL driver.

Link copied to clipboard
const val SCRATCH_FRAMEBUFFER_SIZE: Int = 1024

Per-side resolution of the per-terrain-tile scratch framebuffer that surface shapes are rasterized into. Edge antialiasing comes from MSAA on the multisample framebuffer (see MSAA_SAMPLES); the texture itself stays at the historical 1024.

Link copied to clipboard

Per-cascade shadow-map resolution — reference-tier 2048² per cascade. Apps may assign a different tier before the first frame only: receiver shaders bake these sizes as constants when programs are built and the cascade framebuffers allocate on first use, so the setter validates the shape and refuses changes once any consumer has read the values (late mutation would silently desync shaders, framebuffers, and the layer's texel math). Process-global — shared by all WorldWindows.

Link copied to clipboard
const val SHADOW_MAP_SIZE: Int = 2048

Baseline per-cascade shadow-map resolution (SHADOW_CASCADE_MAP_SIZES). 2048² matches the reference-engine default; depth-pass fill isn't the shadow bottleneck (the receiver resolve is), so it's near-free on frame time - drop to 1024² for lighter VRAM.

Link copied to clipboard
const val SIGHTLINE_MAP_SIZE: Int = 1024

Per-face resolution of the sightline depth cube map. One cube serves both the omnidirectional and directional sightline kinds.

Link copied to clipboard

Soft shadows: true = 3x3 nine-tap PCF kernel; false (default) = a single depth-compare tap whose free 2x2 hardware bilinear still softens the edge one texel. The nine-tap kernel is the dominant shadow fragment cost on mobile (~55% of shadow GPU time measured), so it's opt-in. Baked into receiver shaders - assign before the first frame, like SHADOW_CASCADE_MAP_SIZES.

Link copied to clipboard

Byte budget for surfaceShapeTiles (composited surface-shape RTT textures, ~5 MB each at 1024² RGBA+mip). Bounds GPU memory regardless of how many terrain tiles are panned through; sized to hold a typical visible terrain-tile set plus a pan margin.

Functions

Link copied to clipboard

Reads (and permanently locks) the cascade map size for index.

Link copied to clipboard

Reads (and permanently locks) the soft-shadow flag.