Closed Calinou closed 2 weeks ago
I've been looking into fixing up some of the GLES fog issues because of the fog_sky_affect issue. There are some uniforms in the sky shader but they ain't exactly hooked up to the rendering backend properly. I wanted to pick your brain @Calinou and @clayjohn about what approach the Godot team would like here. Should we pack those guys in a UBO SkySceneData (name in shader) with a struct SkySceneState (mirrored storage on host) to make it more like the Vulkan renderer? Then we would update values in the UBO from RendererEnvironmentStorage in void RasterizerSceneGLES3::_setup_sky. Or should we stick to setting individual uniforms and avoid making a new UBO?
@ParsleighScumble Either approach is fine. Initially I went with the individual uniforms for small things that change frequently, but once you have more than one or two uniforms, it becomes just as fast to pack everything into a UBO that you update every frame.
Let's go with a UBO, then. I should have fog sky affect working in GLES pretty soon.
I can still reproduce this on 4.3.dev 13a0d6e9b.
@ParsleighScumble Did you get it working in the end? If so, please open a pull request :slightly_smiling_face: If not, let us know and someone can continue this work.
I did get it working but it's a bit of a mess and I didn't get tonemapping working for all background modes. I can post what I have though.
I can post what I have though.
Please do :slightly_smiling_face:
I see in https://github.com/godotengine/godot/issues/92019 that fog stops sky affects to be changed, is this the main issue here?
Yes, fog should affect sky rendering to the extent set by the Environment Fog Sky Affect property. That property defaults to 1.0, which means the sky color should match the fog color according to the Camera3D's Z far property (the sky is assumed to be at the same depth as Z far).
Godot version
4.0.beta (53d2a9acd)
System information
Fedora 36, GeForce GTX 1080 (NVIDIA 515.65.01)
Issue description
Unlike in Vulkan, environment fog does not affect sky rendering when using the OpenGL renderer. Fog Sky Affect's value is ignored.
Fog disabled
Fog enabled
Steps to reproduce
--single-window
command line argument.Minimal reproduction project
test_opengl_fog_sky_affect.zip