Use transmittance instead of opacity in the early-out branch when calculating volumetric fog#116107
Merged
Repiteo merged 1 commit intogodotengine:masterfrom Feb 10, 2026
Merged
Conversation
…culating volumetric fog
blueskythlikesclouds
approved these changes
Feb 10, 2026
Contributor
blueskythlikesclouds
left a comment
There was a problem hiding this comment.
Makes sense to me.
Contributor
|
Thanks! |
Contributor
|
Cherry-picked for 4.6.1. |
rivie13
pushed a commit
to rivie13/Phoenix-Agentic-Engine
that referenced
this pull request
Feb 16, 2026
…rly-out Use transmittance instead of opacity in the early-out branch when calculating volumetric fog
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: #116045
This fixes one more case that was implicitly using opacity in the volumetric fog calculations. When we switched to consistently use transmittance in #112494, the result of this early-out became opaque black instead of a fully transparent black. This is because transmittance is
1-opacity.This fix is totally safe and should be backported. The situations where this branch is triggered are quite rare, but should be fixed quickly since it is affecting real projects.
The MRP in #116045 uses a vertex shader to lock a QuadMesh to the near plane of the camera. For some reason that QuadMesh has Volumetric Fog applied to it as well despite being used for post-processing effects. Due to precision issues, fog_pos.z ends up slightly less than
0.0on one corner. Which leads to a large section of the screen being less than0.0due to interpolation. This triggers this branch which, due to #112494, returns a fully opaque black fog. The fully opaque black fog overwrites the color calculated in the shader. And since this shader is actually an opaque QuadMesh, it overwrites the final pixel colour as well.While I think the MRP is a bit silly, the current behaviour is incorrect and avoidable and the MRP should be able to function correctly.