Map 3D: the placed lights shine at night #333

Manually merged
github merged 4 commits from gh-pr/333/head into gh-pr/333/base 2026-11-26 20:28:12 +00:00
Owner

@⁠holdmysocks on GitHub · 2026-11-26 02:06 UTC · original
holdmysocks:six-map3d-lights → master · +441 −6 · 7 files · 4 commits · merged 2026-11-26 03:09 UTC

The map's exterior lights now shine in the HDR view at night. SIX-211.

What it does

  • Which lights. The baked map's exterior lights (lights.bin) that are on at the hour, by their hour mask and night flag. Interior lights are left out.

  • Shading. Lights within about 500 m of the camera are packed each time the camera moves 8 m or the hour changes:

    • a grid of 64 x 64 cells of 12 m around the camera;
    • each cell lists the lights whose range reaches it, at most 32, brightest first.

    Every map surface adds their light: meshes, map cells and terrain tiles. The light falls off as inverse square, windowed to zero at the light's range.

  • Coronas. Every lit light within 600 m, and the brighter ones (intensity 50 or more) to 3 km, draws an additive sprite. The light's irradiance at the eye is spread over a Gaussian of at least a pixel, so far lights shrink to dim points instead of flickering. The haze and fog dim them.

  • --no-placed-lights, or the placed lights shine checkbox, turns them off. The model viewer binds an empty grid and is unchanged.

Own choices (not decoded)

  • One intensity unit gives 0.65 lux at 1 m.
  • All lights shine as points: spot cones and the falloff exponent aren't used yet.
  • The corona core's size (0.08 m). Decorative lights under 3 m range glow only within 150 m.

Checked

  • cargo check -p sixng-gui --tests gives no warnings.
  • naga validates the shaders.
  • New tests: lights:: grid packing and the per-cell cap.
  • GPU screenshots on the test PC (RTX 3090, Vulkan), city at 22 h: streets lit warm, coronas keep the lamp colour at their core (clipped white pixels 9.1k to 1.4k, warm share 0.18 to 0.26). No validation errors or panics.
  • Not changed here: a starburst over the stadium comes from an emissive mesh, not a placed light.
**@⁠holdmysocks** on GitHub · 2026-11-26 02:06 UTC · [original](https://github.com/holdmysocks/SixNG/pull/333) `holdmysocks:six-map3d-lights` → `master` · +441 −6 · 7 files · 4 commits · merged 2026-11-26 03:09 UTC The map's exterior lights now shine in the HDR view at night. SIX-211. ## What it does - **Which lights.** The baked map's exterior lights (`lights.bin`) that are on at the hour, by their hour mask and night flag. Interior lights are left out. - **Shading.** Lights within about 500 m of the camera are packed each time the camera moves 8 m or the hour changes: - a grid of 64 x 64 cells of 12 m around the camera; - each cell lists the lights whose range reaches it, at most 32, brightest first. Every map surface adds their light: meshes, map cells and terrain tiles. The light falls off as inverse square, windowed to zero at the light's range. - **Coronas.** Every lit light within 600 m, and the brighter ones (intensity 50 or more) to 3 km, draws an additive sprite. The light's irradiance at the eye is spread over a Gaussian of at least a pixel, so far lights shrink to dim points instead of flickering. The haze and fog dim them. - `--no-placed-lights`, or the **placed lights shine** checkbox, turns them off. The model viewer binds an empty grid and is unchanged. ## Own choices (not decoded) - One intensity unit gives 0.65 lux at 1 m. - All lights shine as points: spot cones and the falloff exponent aren't used yet. - The corona core's size (0.08 m). Decorative lights under 3 m range glow only within 150 m. ## Checked - `cargo check -p sixng-gui --tests` gives no warnings. - naga validates the shaders. - New tests: `lights::` grid packing and the per-cell cap. - GPU screenshots on the test PC (RTX 3090, Vulkan), city at 22 h: streets lit warm, coronas keep the lamp colour at their core (clipped white pixels 9.1k to 1.4k, warm share 0.18 to 0.26). No validation errors or panics. - Not changed here: a starburst over the stadium comes from an emissive mesh, not a placed light.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:28:10 +00:00
github manually merged commit df9d828d1f into gh-pr/333/base 2026-11-26 20:28:12 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.