Open ricky-daniel13 opened 3 months ago
Fog is drawn here in Forward+: https://github.com/godotengine/godot/blob/3978628c6cc1227250fc6ed45c8d854d24c30c30/servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered.glsl#L1122-L1158
Most notably, see this comment:
Draw "fixed" fog before volumetric fog to ensure volumetric fog can appear in front of the sky.
This change was made in https://github.com/godotengine/godot/pull/42837 a while ago to address https://github.com/godotengine/godot/issues/42820.
Interesting, the behaviour outlined in the solved issue doesn't strike me as correct either. Wonder what could address both.
Interesting, the behaviour outlined in the solved issue doesn't strike me as correct either. Wonder what could address both.
Perhaps we need to do a min or max of the two fogs instead of applying one after another. Or perhaps there is a way we could process them together
Perhaps we need to do a min or max of the two fogs instead of applying one after another. Or perhaps there is a way we could process them together
They already seem to be blended using some formula, not sure what it's supposed to be exactly:
Tested versions
System information
Godot v4.3.rc2 - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1650 (NVIDIA; 32.0.15.5612) - AMD Ryzen 3 2200G with Radeon Vega Graphics (4 Threads)
Issue description
When you enable both Volumetric fog and Distance fog, any point where both fogs overlap, the volumetric fog will lit up/uncover any surface that are expected to be covered by the distance fog. My expected outcome is for the distance fog to always cover the surfaces that are meant to be hidden by it. Not sure if theres a perspective where the expected outcome is the current one.
Windows to black background at end of hallway.
Window completely hidden by fog at end of hallway
Volumetric fog being lit up by the indirect lighing (SDFGI), overlapping the distance fog, lighting up the surfaces previously covered by the distance fog
Volumetric fog being lit up by a spotlight with volumetric enabled, overlapping the distance fog, lighting up the surfaces previously covered by the distance fog
Steps to reproduce
Minimal reproduction project (MRP)
MultiFogTest.zip