Distance fade: fading objects pick up the sky's HDR brightness #150

Closed
opened 2026-09-29 02:16:04 +00:00 by sky_line · 0 comments
Owner

Objects fading out near the draw distance (the distance fog / object fade) blend toward the sky colour, including the sky's HDR scale. Fading objects therefore brighten, and can glow or bloom, instead of simply dissolving into the horizon.

Where

atmosDistanceFade in indra/vkclean/shaders/clean_atmos_common.glsl:

return mix(lin, skyColor(rel, false), f);

skyColor() returns the sky already multiplied by atmosHdrScale() (see its final atmosSrgbToLinear(color.rgb) * atmosHdrScale()), so a fading object is mixed toward an HDR-boosted value.

Fix direction

  • Fade toward the sky colour without the HDR scale (or divided back out), in the same brightness range as the lit object, so the fade reads as haze and not as a light source.
  • Check how bloom and the tonemapper see it: with bloom on, the boosted fade target pushes distant objects over the bloom threshold.
  • Compare with LL/Alchemy's distance fade behaviour for reference (the fade should match the sky at the horizon without over-brightening).
  • Watch water-fogged fragments, which take a separate path (applyWaterFog).
Objects fading out near the draw distance (the distance fog / object fade) blend toward the sky colour, including the sky's HDR scale. Fading objects therefore brighten, and can glow or bloom, instead of simply dissolving into the horizon. ## Where `atmosDistanceFade` in `indra/vkclean/shaders/clean_atmos_common.glsl`: ```glsl return mix(lin, skyColor(rel, false), f); ``` `skyColor()` returns the sky already multiplied by `atmosHdrScale()` (see its final `atmosSrgbToLinear(color.rgb) * atmosHdrScale()`), so a fading object is mixed toward an HDR-boosted value. ## Fix direction - Fade toward the sky colour **without** the HDR scale (or divided back out), in the same brightness range as the lit object, so the fade reads as haze and not as a light source. - Check how bloom and the tonemapper see it: with bloom on, the boosted fade target pushes distant objects over the bloom threshold. - Compare with LL/Alchemy's distance fade behaviour for reference (the fade should match the sky at the horizon without over-brightening). - Watch water-fogged fragments, which take a separate path (`applyWaterFog`).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sky_line/Slipstream#150
No description provided.