`Fog.SkipBackground` only exempts pixels at cleared depth exactly 1.0 — any real sky dome is fogged flat; flag silently does nothing
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 7.8k
- Forks
- 1.2k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 49
Description
Release Type: Official Release
Version: 4.3.0.2507
Platform(s): All backends
Describe the bug
FogEffect.sdsl implements SkipBackground as if (!skipBG || z_b < 1.0) — it exempts only
pixels still holding the cleared depth of exactly 1.0. Any sky drawn as ordinary geometry
writes a depth just under 1.0 (a 2000 m dome under a 2400 m far plane writes ~0.999992), so the
flag silently does nothing and the sky is blended toward the single FogColor like any other
surface. At a plausible ground-fog density (0.00155/m) that is ~95% fog over the entire sky —
we measured clear-sky patches (185,194,213) vs the brightest cloud (186,194,209): four units of
separation across the whole sky. Nothing in the API documents the depth-exact requirement.
To Reproduce
- Scene with a sky dome mesh (any radius < far plane) +
PostProcessingEffects.Fogwith
SkipBackground = true, density high enough to see. - The sky fogs to one flat color despite the flag.
Expected behavior
SkipBackground = true exempts the background/sky, or the docs state the depth-exact contract.
Additional context
Fix shapes: compare against a far-plane epsilon (z_b < 1.0 - eps); or expose a distance-based
cutoff (FogEnd/SkipBeyondDistance) — distance-based is what we shipped app-side (custom
fog shader with a radial-distance exemption) and it also fixes the screen-edge artifacts that a
view-Z exemption produces. At minimum, document that only cleared-depth pixels are exempt.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with FogEffect.sdsl and inspect the SkipBackground condition described in the report. Reproduce the issue with a sky dome, then establish whether the fix should use a far-plane epsilon, a distance-based cutoff, or documentation of the cleared-depth contract; done means the chosen behavior is verified with the reported sky scene.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- computer-graphics, game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100