Skip to content

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.

LevelPixel ratio capAnti-aliasingTerrain screen-space errorTerrain tile cacheHorizon LODWhile moving
Highdevice (no cap)MSAA 48768 MBofffull resolution (×1)
Balanced1.5MSAA 212384 MBon×0.66
Low1FXAA (MSAA off)20160 MBon×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.

The resolution applied to the Cesium viewer is:

  • settled = min(1, maxPixelRatio / devicePixelRatio)
  • moving = settled × movingScale, applied only when movingScale < 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:

  1. Low if any of the following hold:
    • the WebGL renderer string matches swiftshader, llvmpipe, softpipe, software or microsoft basic render (case-insensitive);
    • the device is a phone: a coarse pointer and a screen short side below 600 CSS pixels;
    • navigator.deviceMemory is 4 GiB or less;
    • navigator.hardwareConcurrency is 4 or less.
  2. Balanced if any of the following hold:
    • the pointer is coarse (touch device);
    • deviceMemory is below 8 GiB;
    • hardwareConcurrency is below 8;
    • the device pixel ratio is above 2.
  3. High otherwise.

deviceMemory is reported by Chromium only and is capped at 8 by the browser.

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.

  • The chosen level is stored per browser under the key lunartrace.moon.quality. The default, when nothing is stored or storage is unavailable, is auto.
  • 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.

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.