-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
Implement render mode fog_disabled
and BaseMaterial3D setting Disable Fog
#81286
Implement render mode fog_disabled
and BaseMaterial3D setting Disable Fog
#81286
Conversation
The flag needs to be documented, see the CI errors |
e1e2180
to
0341df4
Compare
I'm not quite sure what causes the failure in this pipeline: https://github.com/godotengine/godot/actions/runs/6067098408/job/16458879823?pr=81286 |
Unrelated to this PR, sporadic error |
servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered.glsl
Outdated
Show resolved
Hide resolved
servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered.glsl
Outdated
Show resolved
Hide resolved
servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile.glsl
Outdated
Show resolved
Hide resolved
edf0262
to
6b325e3
Compare
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.
Code looks good to me and I have tested locally and everything seems to be working fine!
Great work!
For maintainers, this should be merged in 4.2, but not cherrypicked to 4.1
fog_disabled
and BaseMaterial3D setting Disable Fog
Could you please squash your commits into one? Make sure that the final commit has a short but descriptive message (the title of this PR is a good option). See this documentation, if you need help with squashing. |
6b325e3
to
45a33cc
Compare
Done ✨ |
Thanks, and congrats on your first merged Godot PR! |
Thank you! |
This fixes #56374 (and its duplicates like #69268).
A new render mode called
fog_disabled
is added. It can be used in spatial shaders (usingrender_mode fog_disabled
) and fromStandardMaterial3D
using the new toggleDisable Fog
found in theShading
section.This works for the Forward+, Mobile and Compatibility rendering backends.
Documentation for the new render mode and material setting has been added in this PR: godotengine/godot-docs#7875
Screenshots
Minimal reproduction project
The minimal reproduction project from #56374 has been modified to include a DirectionalLight3D (without which the volumetric fog wouldn't render anymore), and the new
disable_fog
property has been enabled on the unshaded additively blended mesh. I've also enabled the depth-based fog to test the effect on the Mobile and Compatibility render backends as they don't support volumetric fog, and added a cube with a shader material usingrender_mode unshaded;
to demonstrate this working as well.It can be downloaded here:
Fog_Volume_Additive.zip