Open atirut-w opened 2 years ago
Related to https://github.com/godotengine/godot/issues/62794.
Do you also have SSIL enabled in the Environment?
Disabling SSIL doesn't seem to have an effect on the flashing
I took a quick look into this, the problem is that, when the viewport is resized, the Fog buffers are deleted and then recreated, but in the meantime the sky/objects are drawn. Since the fog buffers are not initialized yet a plain white texture is used instead leading to the flicker.
The solution will be to update the volumetric fog textures immediately after deletion/creation so there is no blip
I can still reproduce this on 4.0.beta3.
Quoting clayjohn from the Godot Contributors Chat:
It is a known issue and we have a few options to resolve it. Its not caused by temporal reprojection, it happens because the volumetric fog buffer gets deleted right before rendering the frame again so the next frame after the clear uses the default clear values.
I think the best option is, instead of clearing the newly allocated fog buffer, we should copy the old fog buffer over and just stretch/squash it to fit, it won't be perfect if size/aspect change a lot, but it should help
The same approach can also be used to fix https://github.com/godotengine/godot/issues/56724.
Still reproducible in 4.3, I just wanted to add that bottom panels chagne the viewport too and with the FileSystem being dockable (and in the future releases possibly other panels soo) and the shortcuts to open/close these panels this is getting quite prominent since the new workflow encourages fluidly opening and closing the panels, I've noticed this testing the PRs and the flashing gets really apparent and annoying ;0.
I can still reproduce this on 4.0.beta3.
Quoting clayjohn from the Godot Contributors Chat:
It is a known issue and we have a few options to resolve it. Its not caused by temporal reprojection, it happens because the volumetric fog buffer gets deleted right before rendering the frame again so the next frame after the clear uses the default clear values. I think the best option is, instead of clearing the newly allocated fog buffer, we should copy the old fog buffer over and just stretch/squash it to fit, it won't be perfect if size/aspect change a lot, but it should help
The same approach can also be used to fix #56724.
@clayjohn I came down to using a double buffer. Here is my results:
Before
https://github.com/godotengine/godot/assets/169231366/6461077d-6bed-41b1-aa06-6d72ab421656
After
https://github.com/godotengine/godot/assets/169231366/349c76c3-20ad-400d-ae78-5bdb3d3eead0
I did some testing by just saving the current state and reusing it without these buffers, but that just completely turned off the volume.
As you can see:
This looks great, but doesn't using a double buffer mean there's an additional frame of latency? This might not be a huge deal in most cases given volumetric fog is low-frequency data, but still.
I tried a variety of things, but I ended up using the earlier suggestion to fix it. I just reused the previous fog buffer. It looks the same as the "After" video.
Godot version
v4.0.alpha13.official [59dcddc45]
System information
Fedora Linux 36 (Workstation Edition), Vulkan Clustered, GTX 1660
Issue description
When the viewport is being resized with VL fogs enabled, it flashes white for about a single frame.
(Epilepsy warning)
https://user-images.githubusercontent.com/25323231/182040843-e52dc349-d503-49a5-aeb7-d13e78fdc5e9.mp4
Steps to reproduce
Minimal reproduction project
No response