Skip to content
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

Fog color gets brighter if multiple directional lights are added to a scene #48101

Closed
CahootsMalone opened this issue Apr 22, 2021 · 2 comments
Closed

Comments

@CahootsMalone
Copy link

CahootsMalone commented Apr 22, 2021

Godot version:
3.2.3.stable.official

OS/device including version:

  • OS: Windows 10 Home (64-bit, version 20H2, OS build 19042.928)
  • GPU: NVIDIA GeForce GTX 1050 (driver version 27.21.14.5206)
  • Backend: GLES3

Issue description:
I've noticed that adding more than one directional light to a scene makes the fog color (the color objects fade to as they approach the fog depth end distance) brighter than the color specified in the environment settings. The increase in brightness is proportional to the number of directional lights added after the first one. I expected that the fog color would be unaffected by the number of directional lights in the scene.

This happens even if the additional directional lights have their color set to black and their energy, indirect energy, and specular intensity values all set to zero.

There are a few additional details in this forum post.

Steps to reproduce:
Note: I recommend downloading the minimal reproduction project (below) to save time; forum user cybereality was able to reproduce the issue using it.

  • Create a new scene and add a camera
  • Create a new environment
    • Set the mode to custom color and set the sky color
    • Enable fog and set the fog color to the same color as the custom sky color
    • Set the fog depth end distance to a value substantially less than the camera's far clip distance (to make the effect obvious)
  • Set the camera's environment to the one with fog enabled
  • Add cubes (or other meshes) at various distances from the camera
    • Ensure at least one mesh is beyond the fog's depth end distance
  • Add a directional light pointing along the camera's view axis
  • Note that the mesh beyond the fog's depth end distance isn't visible (it fades to the fog color, which is the same as the sky color)
  • Add a second directional light
  • Note that the mesh beyond the fog's depth end distance is now visible, and that the fog color is brighter
  • Repeat with additional directional lights and observe that the fog distance continues to get bright with each one

Minimal reproduction project:
Please see FogTest.zip, attached: FogTest.zip

  • Turn on preview for the camera in the scene
  • Observe that the cube beyond the fog depth end distance isn't visible (it's faded to the fog color, which is set to the sky color)
  • Turn on the second directional light and note that the fog color is now brighter than the color specified in the environment settings (the cube beyond the fog depth end distance is visible now)
  • Turn on the third directional light and note that the fog color is brighter than with two lights

The GIF below illustrates use of the minimal reproduction project:

Demo

@Calinou
Copy link
Member

Calinou commented Apr 22, 2021

I can confirm this on 3.3 on Linux (GeForce GTX 1080), but only on the GLES3 renderer. In GLES2, only the first directional light is taken into account, even if it's hidden.

@akien-mga
Copy link
Member

Fixed by #53938.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants