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

Disable all sources of ambient light when ambient_light_disabled render mode is used #92213

Merged
merged 1 commit into from
Aug 19, 2024

Conversation

clayjohn
Copy link
Member

Fixes: #83593

In #66107 we agreed to reinstate the ambient_light_disabled render mode and use it to disable all ambient light contributions. However, the actual code only disabled diffuse ambient light and not specular ambient light. This led to it doing essentially nothing on metallic materials and running the full ambient light calculations for all materials.

I noticed this issue while debugging performance in a 3D scene with @RPicster. A transparent object was doing the full VoxelGI calculation in the forward pass, even when ambient light was disabled.

This change will technically change behaviour as it will disable specular ambient light in addition to diffuse. IMO this is an acceptable change in behaviour because the previous behaviour was unexpected, bad for performance, and ultimately the result of a bug. That being said, I am tagging it for 4.4 as we are too late in the 4.3 dev cycle to introduce a change in behaviour.

@clayjohn clayjohn added this to the 4.4 milestone May 21, 2024
@clayjohn clayjohn requested a review from a team as a code owner May 21, 2024 18:13
Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally with all rendering methods (rebased on top of master 25ff130), it works as expected. The rationale makes sense to me.

Testing project: test_ambient_disabled.zip

Before After (this PR)
Before After

@akien-mga akien-mga merged commit 824a971 into godotengine:master Aug 19, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

ambient_light_disabled does not completely disable SDFGI contribution
3 participants