-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Fix custom fog, and make FOG
built-in readable
#54292
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why calculate volumetric fog after? Wouldn't it make sense to do fixed fog and volumetric fog before custom fog?
I thought this would be better because I consider volumetric fog to be an additional effect beyond standard fog, and that this custom fog applies to standard fog only. For the linear fog example, this ordering is important. However, I can see why the opposite might be preferred for other uses. Perhaps this could be made configurable by adding a |
9d5a9cb
to
92f3096
Compare
@clayjohn Would you prefer I calculate volumetric fog alongside regular fog before custom fog, restoring original behavior? Or do you think adding a render mode option is a good idea? |
@briansemrau That is a difficult question. To me it made sense to do them together, but for you it was more intuitive to have FOG only override fixed fog. This highlights the issue when devs add features without proposals. I clearly don't have a good sense of what users need and didn't realize that users may have different expectations for this feature. You or I should write a proposal and try to get some feedback from users. |
I was thinking about this again. I wonder if the ideal approach is just to expose the |
I fear that will make things a bit more complicated than most use cases would demand it. Another reason is that volumetric and normal fog are blended in magical ways no one understands, so having to reliably "reconstruct" the real fog color that is applied from two different functions... wouldn't really help me personally a lot 😵 Why not both? :D |
Fixes shader custom fog (#41415), which was likely broken since #45023.
Additionally, the fragment shader built-in
FOG
allows for modification of standard fog, rather than just overwriting it. This allows for simple tweaks, such as:Linear fog could be implemented like so (taken from #54248):
One difference to note from the original custom fog PR is that custom fog now mixes before volumetric fog rather than after.
Will need updating in the docs (see: godotengine/godot-docs#4301)