Tested versions
4.2.2, 4.3.beta3
System information
Windows 11, Compatibility
Issue description
Writing to FOG in a shader works fine in Forward+ and Mobile, regardless of whether there is a WorldEnvironment node with fog enabled in the scene. This leads me to believe writing to FOG is intended to entirely override fog from any WorldEnvironment node. However, with the Compatibility renderer, writing to FOG only works if there is a WorldEnvironment node with fog enabled.
Steps to reproduce
Add a node, like a MeshInstance3D, to a scene. Add a ShaderMaterial to it and give that a shader which writes to FOG in the fragment function. If you're using the Forward+ or Mobile renderers, you should see the fog color of the node change. However, with the Compatibility renderer, you'll need to add a WorldEnvironment node, give it an Environment resource, and enable fog; only then will you see the fog color change to what you instructed it to in the shader.
Minimal reproduction project (MRP)
Fog Shader Compatibility Issue MRP.zip
Tested versions
4.2.2, 4.3.beta3
System information
Windows 11, Compatibility
Issue description
Writing to
FOGin a shader works fine in Forward+ and Mobile, regardless of whether there is a WorldEnvironment node with fog enabled in the scene. This leads me to believe writing toFOGis intended to entirely override fog from any WorldEnvironment node. However, with the Compatibility renderer, writing toFOGonly works if there is a WorldEnvironment node with fog enabled.Steps to reproduce
Add a node, like a MeshInstance3D, to a scene. Add a ShaderMaterial to it and give that a shader which writes to
FOGin thefragmentfunction. If you're using the Forward+ or Mobile renderers, you should see the fog color of the node change. However, with the Compatibility renderer, you'll need to add a WorldEnvironment node, give it an Environment resource, and enable fog; only then will you see the fog color change to what you instructed it to in the shader.Minimal reproduction project (MRP)
Fog Shader Compatibility Issue MRP.zip