Repository navigation
WorldWind Kotlin 2.0.6
This release rebuilds the real-time visibility stack: cascaded sun shadows and sightline analysis are rewritten on depth-texture pipelines with PCF filtering — moment shadow maps are gone from the engine — with hardware depth-compare samplers on capable GPUs, off-screen shadow casters, alpha-cutout shadows, and hemispheric ambient shading. Alongside: a 3D Tiles texture-upload throttle, a batch of iOS stability fixes, and MVT vector layer-ordering and offline-cache fixes.
🌑 Shadow pipeline rewritten as depth-texture CSM
- Depth-only cascade maps with tent PCF replace the previous moment-based cascades. Receiver shadow math is camera-relative and caster matrices compose in double precision — raw ECEF float32 quantizes to ~0.5 m and erased street-scale shadow structure. Cascades fit the accumulated scene bounds with sticky hysteresis and a texel-snapped light anchor, so the maps stay bit-stable under camera motion. Casters rasterize double-sided (photogrammetry winding is unreliable), and terrain casters skip 3D-Tile coverage regions so the coarse elevation surface can't blanket photogrammetry in false shadow.
ShadowLayer.debugShadowModeadds cascade-band / footprint / map-depth debug views. - Off-screen casters keep casting — view-frustum-culled shapes, COLLADA/glTF models, and 3D tiles that intersect the street-scale cascade regions still rasterize into the shadow maps (previously their shadows popped in and out as the camera turned). 3D tiles refine against a coarser screen-space-error budget for shadow-only selection, and all keepalive content skips the color pass. Tunable via
ShadowLayer.offscreenCasterCascades(default 2, 0 disables). - Alpha-masked casters cast their cutout silhouette — cutout-textured 3D-Tile submeshes (alphaMode MASK) discard transparent fragments in the depth pass instead of casting full-quad slab shadows.
- Shadows fade across the terminator instead of vanishing in a single frame at sunset; sun elevation is judged against the shaded content's position, so an orbital camera keeps shadows on sunlit terrain viewed across the limb.
- Casters sunward of a cascade's near plane are pancaked onto it, so a distant mountain toward a low sun still shadows street-scale cascades instead of being clipped out of the depth map.
- Elevated casters gate per cascade — a single model at altitude no longer inflates every cascade's depth window (which cost depth precision and detached contact shadows scene-wide); only the cascades its light-space footprint overlaps are lifted.
- Receiver depth bias is now in world metres, normalized per cascade at upload, so bias tuning means the same thing in every scene regardless of depth-window size.
- Two receiver safeties: tap depths clamp to [0, 1] (fixes false dark speckle on far-cascade valley floors at grazing sun on the software path), and the shadow distance cap uploads the fitted coverage end so a hard cutoff line can never appear inside populated cascade coverage.
🔭 Sightline rewritten on a depth cube
- One depth-only cube map serves all sightlines, resolved by tent PCF with receiver-plane depth prediction (cures grazing-pavement acne for street-level observers). All six faces render, so receivers above the observer — city-canyon facades — tint correctly. Terrain tiles inside 3D-Tile coverage are skipped as occluders, matching the shadow pass.
DirectionalSightlineandOmnidirectionalSightlinemerge intoRealtimeSightline(breaking) — the cube always covers the full sphere, so direction is just a receiver-side mask:fieldOfViewnow spans (0°, 360°], where 360° is the former omnidirectional and the old 90° limit is gone. Named against its static-analysis peerViewshedSightline.- The depth-cube pass is range-culled — terrain tiles and occluders whose bounds miss the observer's range sphere skip all six faces. Previously a street-scale observer rasterized the whole visible terrain set six times; the cube also survives pans that used to invalidate it.
- Multi-window safety: the sightline receiver scratch matrix moved onto the per-window draw context, and the depth-cube bind cache is invalidated whenever a benign cube is parked, so receiver order can never sample the wrong cube.
📐 Viewshed fixes
- The GPU ray-walk's constant step cap silently painted every cell beyond it visible; a rectangular AOI with the observer near a corner reported false coverage across its far region. The cap is now exact per dispatch, and an exhausted walk reads occluded — the conservative default.
- The draft → full-resolution refine could stall forever on event-driven platforms (JVM/Android) when a draft dispatch spanned more than one frame; the frame pump now keeps running while escalation work is pending.
⚡ Hardware depth-compare receivers
- Shadow and sightline receivers compile as GLES 3 / WebGL 2 / GL 3.3 core with
sampler2DShadow/samplerCubeShadowwhere the platform supports them: nine hardware 2×2-PCF taps replace the 16-fetch software cascade filter, and each cube tent tap becomes one hardware compare. GLSL ES 1.00 in-shader compares remain the WebGL1 fallback, and Adreno GPUs stay on the software path (hardware compare is driver-unpredictable there). Also fixes the depth-read quantization artifacts (zebra stripes/circles) on Mac "Designed for iPad" builds.
💡 Shading
- Hemispheric ambient for lit shapes, meshes and 3D tiles: the flat 0.35 ambient becomes a sky/ground hemisphere term with the same average — up-facing surfaces read sky-lit, undersides ground-lit, vertical walls unchanged.
🚀 Performance
- 3D Tiles: byte-budgeted texture uploads — city-scale loading eager-bound every freshly-installed texture in one frame (a single 2048² mipmapped texture is ~21 MB of
glTexImage2D), producing 20–150 ms GL-thread stalls. Uploads now drain in per-frame batches capped by measured upload throughput, targeting a 3 ms bind slice. - Android: no more double draw — every discrete redraw and every pick used to cost a second full-scene draw of identical content; the follow-up GL pass is now requested only while the pick or frame queue still holds work.
🍏 iOS fixes
SynchronizedPoolwas a plain unsynchronized pool despite the name; tile-decode workers and the render thread share the engine's pools, so concurrent access could corrupt them or hand the same instance to two consumers. Now locked, mirroring the JVM/Android contract.- 3D Tiles child-URI resolution collapses
../dot segments — servers 403 raw dot segments sent verbatim by the Darwin HTTP stack, which spun tile fetching in an endless cancel/re-auth loop. - The render-resource cache sizes to physical memory like Android; the fixed 512 MB cap caused cyclic texture eviction on horizon views (whole-frame flicker and transient geometry corruption).
- The native Draco decoder is enabled in the Xcode run script (the no-op stub decoded Draco tiles to empty geometry), and the Kotlin framework is declared as a script-phase output so the app relinks instead of shipping a stale build.
- A cached feature source that yields zero rows refetches from origin, and an undecodable persisted feature file is deleted instead of leaving the layer blank forever.
🗺 Vector layers & MVT
- Layer order now wins for draped shapes — MVT content rendered above imagery and user surface shapes regardless of layer order because it enqueued at elevated z bands; all MVT draped content now sits at the shared surface z, matching the insertion-order model of the reference engines.
- Data-availability sector persisted —
VectorLayer.sector(mirroringElevationCoverage.sector) gates tile assembly; bulk downloads union the region into it, it persists as the GeoPackage content bbox, and reopening a cache restores it. - Request headers persist with the cache — a reopened cached MVT layer keeps e.g. the
User-AgentOSM's tile policy requires. - No-data tiles stay transparent instead of painting an opaque style-background sheet over underlying layers.
- Default styles aligned with live reference tile schemas: road
_linkramps, OMTpath/trackclasses,rock/wetlandlandcover, OpenTopoMap cream background, and no more debug-gray fill on unmapped layers.
🐞 Fixes
- SLPK: texture names are resolved from I3S metadata (
textureSetDefinitions, or the legacy per-node href) instead of a hardcoded0.jpg— fixes white untextured meshes on Metashape-produced packages. - GeoPackage: a cancelled reader can no longer leak the read-handle pool empty.
📚 Tutorials
- The 3D Tiles Archive (
.3tz/.3dtiles) tutorial now runs on Android too, sharing one implementation with JVM.
📦 Dependency updates
- mil-sym 2.11.2 (Android) / 2.8.2 (Java) / 2.9.2 (TS), xmlutil 1.0.1.
Full changelog: v2.0.5...v2.0.6