garage44.eu/jeroen/cartopolis

logclone: git clone https://garage44.eu/jeroen/cartopolis.git

.. /docs/adr/005-sky-lighting-system.md

raw

ADR-005: Sky and Lighting System


Metadata:


Context

Problem: The scene needs a sky and proper lighting. A solid void background and basic directional light do not provide sufficient visual quality or a sense of place.

Requirements:

Decision

Use Bevy 0.19's built-in bevy_pbr atmosphere (planetary-scale physical scattering) on the camera, with a DirectionalLight sun whose colour/illuminance and exposure follow a day/night cycle.

Approach:

Migration note: originally bevy_atmosphere (Nishita); that crate was dropped in the Bevy 0.19 upgrade in favour of the engine's built-in atmosphere.

Rationale

Primary Reasoning:

  1. Built-in, no external crate — bevy_atmosphere had no Bevy 0.19 release when we upgraded; the engine's own atmosphere is on 0.19 and is planetary-scale (essential for the globe/space tier).
  2. Physical scattering feeds the sun light directly, so sky and surface lighting stay consistent across the day/night cycle.
  3. Works from orbit — procedural sun disk + raymarched mode render with no ground geometry.

Alternatives Considered:

AlternativeProsConsRejected Because
bevy_atmosphere (original)Was working on 0.16No Bevy 0.19 release at upgrade time; not planetary-scaleDropped in the 0.19 upgrade
Skybox / gradient skySimple, cheapStatic; no day/night or altitude responseFails the planetary + cycle requirements
Custom scattering shaderFull controlHigh effortBuilt-in atmosphere is sufficient

Consequences

Positive:

Negative:

Related