-
-
Notifications
You must be signed in to change notification settings - Fork 23.5k
Clean up Volumetric Fog blending behavior #112494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
clayjohn
wants to merge
1
commit into
godotengine:master
Choose a base branch
from
clayjohn:rd-fog-blend
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+17
−16
Conversation
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
Member
Author
Out of date comment, hidden for readabilityFor reference here are the correct blending equations: However, this results in volumetric fog looking extremely strong, just like in #112468 |
Use proper blending everywhere to be consistent and avoid multiplying by opacity twice.
44a639f to
8ee3897
Compare
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.
Closes: #112468, but only if merged along with godotengine/tps-demo#212
This PR finished the work that #111998 started. Prior to #111998 we were wrongly blending Volumetric Fog with the scene. In particular, by using the
mix()function to blend Volumetric Fog, we were applying the fog's opacity twice. Effectively making thin fog much thinner. This had the effect of making fog much darker than it should be which is especially noticeable at the edge of Fog Volumes since it produces a dark outline (as reported in #101514)This PR cleans up the Volumetric Fog code to be more consistent and use transmittance everywhere instead of opacity. transmittance makes the blending calculations a lot simpler, so this PR has the bonus effect of making our code slightly more efficient as well.
Warning: This is technically a compatibility breaking change. Users who previously compensated for the fact that opacity was multiplied twice will experience visual changes especially if they are using extreme values like we do in the TPS demo. Users who have default settings or denser fog will not notice much or any change.
At any rate, I think we need to go ahead with this and live with the small compatibility breakage as it will be much better in the long run to have the underlying bug fixed