- Slim AGENTS.md from 505 to 163 lines; extract §17 Coding Principles and §16 Debugging Tips into .agents/context/ reference files - Add native paths: frontmatter to all 10 .agents/rules/ domain files so they only auto-load when editing matching file paths - Move 10 on-demand reference files from .agents/rules/ to .agents/context/ (no longer eagerly scanned on every session start) - Create .agents/context/INDEX.md navigation table for agents - Create .agents/context/coding-principles.md (extracted from AGENTS.md) - Remove /.agents/context from .gitignore (now holds versioned reference docs) Baseline session context: ~165KB → ~4KB Worst-case (plugin work): ~165KB → ~44KB Co-authored-by: Claude Sonnet 4.6 <[email protected]>
3.9 KiB
description, paths
| description | paths | |||
|---|---|---|---|---|
| Strict guidelines for rendering geospatial entities, handling 3D terrain clipping, and applying dynamic animation properties against Cesium's runtime engine. |
|
Cesium Rendering Rules
Purpose
Strict guidelines for rendering geospatial entities, handling 3D terrain clipping, and applying dynamic animation properties against Cesium's runtime engine.
When to Apply
Whenever writing code for plugins, visual layers, or modifying components like EntityRenderer or GlobeView.
Critical Limitations
HeightReference.CLAMP_TO_GROUND Warning
Warning
Do not apply
HeightReference.CLAMP_TO_GROUNDto label text rendering (LabelGraphics). Due to a known issue in Cesium 1.121+, clamping tens of thousands of dynamic labels blocks the UI thread continuously because Cesium recalculates the terrain intersection each frame.
Primitive Restrictions
When creating primitive objects:
- Points (
PointPrimitive): Can usesize,outlineWidth, andoutlineColor. - Billboards (
BillboardGraphicsfor SVG/Icons): Must NOT usesize,outlineWidth, oroutlineColor. You must useiconScaleto resize them. Mixing point properties on billboards causes severe shader clipping.
Sizing Conventions
| Entity type | Knob | Default | Typical band | Source |
|---|---|---|---|---|
point |
size |
8 desktop / 12 mobile |
5–12 | src/core/globe/primitiveOps.ts (defaultPointSize) |
billboard |
iconScale |
0.7 (DEFAULT_BILLBOARD_SCALE) |
0.6–0.9 | src/core/globe/primitiveOps.ts (DEFAULT_BILLBOARD_SCALE) |
model |
modelScale |
1.0 + modelMinPixelSize |
varies per asset | src/core/globe/ModelManager.ts, src/core/globe/hooks/useModelRendering.ts |
Important
Cross-plugin parity rule. If your plugin renders alongside maritime / aviation / military-aviation on the globe, leave
iconScaleunset (or pick a value inside 0.6–0.9). A value below 0.5 will look visibly broken next to peer plugins. A value above 1.0 will dominate the globe.
Caution
Silent-ignore footgun.
sizeis aPointPrimitiveproperty. If you setsizeon abillboardentity it is silently dropped — Cesium does not error and the billboard simply renders atDEFAULT_BILLBOARD_SCALE. When converting a point plugin to a billboard plugin, replacesize: NwithiconScale: ~N/16(the canvas base isgetBaseSize() = 48pxdesktop) — do not delete it and do not translate it literally asiconScale: N/10. This footgun has shipped at least once (see commit history onlocal-plugins/wwv-plugin-satellite).
Note
Backdrop stack.
createSvgIconUrl(in the SDK) already wraps the icon in a 44×44 SVG with a dark backdrop circle.src/core/globe/iconUpscaler.tsthen redraws onto a 48px canvas with another backdrop circle (DEFAULT_BG = "rgba(15, 23, 42, 0.55)"). Passbackground: falsetocreateSvgIconUrlwhen you want only the host's circle. Don't add a third backdrop in your own SVG.
Performance Culling
Tip
Do not rely solely on depth buffering (
disableDepthTestDistance) when viewing the backside of the globe. Use CPU-side calculating (dot-product against the Earth's radius) to implement manual horizon culling. Render nothing if the scalar projection is behind the tangential threshold.
LOD & Stacking
- Convert distant entities to
billboardrepresentations. - If closely grouped, the
StackManagershould spiderify components circularly. Non-hub objects fade to 0.4 opacity when expanded to reduce visual clutter. - Use the
useModelRenderinghook exclusively for transitioning high-importance entities (like aircraft or ships) into full 3D GLTF models on approach.