Render quality
The Moon toolbar’s quality menu (Auto, High, Balanced, Low) changes display cost only. It never
changes data, masks, cell resolution or any Python result. Profiles are defined in
web/moon/quality.ts, a pure module with no Cesium import.
Levels
Section titled “Levels”| Level | Pixel ratio cap | Anti-aliasing | Terrain screen-space error | Terrain tile cache | Horizon LOD | While moving |
|---|---|---|---|---|---|---|
| High | device (no cap) | MSAA 4 | 8 | 768 MB | off | full resolution (×1) |
| Balanced | 1.5 | MSAA 2 | 12 | 384 MB | on | ×0.66 |
| Low | 1 | FXAA (MSAA off) | 20 | 160 MB | on | ×0.5 |
The profile values are the constants in QUALITY_PROFILES. The cache sizes are 768 * 1024 * 1024,
384 * 1024 * 1024 and 160 * 1024 * 1024 bytes. Terrain screen-space error is the Cesium
maximumScreenSpaceError threshold: a higher value means coarser terrain.
Resolution scale
Section titled “Resolution scale”The resolution applied to the Cesium viewer is:
- settled =
min(1, maxPixelRatio / devicePixelRatio) - moving =
settled × movingScale, applied only whenmovingScale < 1
The result is multiplied by the device pixel ratio by Cesium. For example, on a device with a pixel ratio of 2, Balanced settles at 0.75 (a drawing buffer of 1.5 pixels per CSS pixel) and renders at about 0.495 while the camera moves. Low settles at 0.5 (1 pixel per CSS pixel) and renders at 0.25 while moving. High is not capped and moves at full resolution.
The choice Auto is resolved from device facts. An unknown fact (a value the browser does not expose) never triggers a cheaper level, so Auto falls through to a higher level when facts are missing.
Rules, evaluated in order:
- Low if any of the following hold:
- the WebGL renderer string matches
swiftshader,llvmpipe,softpipe,softwareormicrosoft basic render(case-insensitive); - the device is a phone: a coarse pointer and a screen short side below 600 CSS pixels;
navigator.deviceMemoryis 4 GiB or less;navigator.hardwareConcurrencyis 4 or less.
- the WebGL renderer string matches
- Balanced if any of the following hold:
- the pointer is coarse (touch device);
deviceMemoryis below 8 GiB;hardwareConcurrencyis below 8;- the device pixel ratio is above 2.
- High otherwise.
deviceMemory is reported by Chromium only and is capped at 8 by the browser.
Governor
Section titled “Governor”The governor applies only when the stored choice is Auto and the current level is not already Low.
- While the camera is moving, the viewer records the interval between rendered frames.
- After every 30 frames, the median interval is compared with a budget of 50 ms.
- If the median exceeds 50 ms, the level steps down by one: High to Balanced, Balanced to Low. Low does not step further.
- The step is held in component state. It does not change the stored choice.
- On the settled frame (camera not moving), the full profile resolution is restored and the scene renders on demand.
Choosing High, Balanced or Low explicitly disables the governor.
Storage and determinism
Section titled “Storage and determinism”- The chosen level is stored per browser under the key
lunartrace.moon.quality. The default, when nothing is stored or storage is unavailable, isauto. - Storage access is wrapped; if storage is blocked, the choice lasts for the page only.
- Flight renders and the R2 page always use
quality="high", so their output stays deterministic.
Known display issues
Section titled “Known display issues”In headless software WebGL captures (SwiftShader), the Moon terrain is sometimes black. Auto selects Low for software renderers. Real browser rendering is not established by the headless captures.