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

Vulkan: Indirectly lit surfaces show up black in reflections when using SDFGI with Bounce Feedback set to 0.0 #49836

Closed
Tracked by #55327
DKesserich opened this issue Jun 22, 2021 · 5 comments

Comments

@DKesserich
Copy link

Godot version

4.0 dev (af451ff)

System information

Windows 10, Vulkan, Radeon 5700XT

Issue description

Surfaces that are being lit by bounced lighting when SDFGI is active are reflected as if they are receiving no lighting at all.
image

Steps to reproduce

Extreme Example:
Create a 3D scene with a World Environment and enable SDFGI.
Build an enclosed volume out of MeshInstance3Ds (either planes or cubes)
Place a sphere inside the enclosed volume. Set the sphere material to have a metalness of 1 and a roughness of 0.
Place an OmniLight or a Spotlight inside the volume. Set the Range (if OmniLight) or the Angle (if Spotlight) to a low amount.
Set the Energy high enough for bounce lighting to fill the interior.
Observe that only the parts of the surface that are receiving direct lighting will be reflected in the sphere.

Minimal reproduction project

SDFGITest.zip

@DKesserich
Copy link
Author

SDFGI doesn't seem to work at all on latest. I had to go back two weeks to find a commit where it worked.

@Calinou
Copy link
Member

Calinou commented Jun 22, 2021

I'm not sure if this is a bug or a design decision to improve performance. The generated SDF may not be able to store indirect light to display it in reflections in the first place.

There are plans to refactor SDFGI to add more features to it and improve performance, but this may be done aftere 4.0 is released.

SDFGI doesn't seem to work at all on latest. I had to go back two weeks to find a commit where it worked.

This is a known issue.

@Calinou
Copy link
Member

Calinou commented Aug 30, 2021

It seems that increasing SDFGI's Bounce Feedback above 0.0 seems to resolve this (try 0.5). Don't set it too high or infinite feedback look will happen, making surfaces overly bright.

Therefore, #39965 would resolve this out of the box if it's merged.

It's also interesting to note that changing Bounce Feedback updates reflections instantly, but diffuse light in the 3D world will take a while to update. Increasing Bounce Feedback above 1.0 will not further brighten reflections as well.

Bounce Feedback 0.0 (default)

image

Bounce Feedback 0.5

image

Bounce Feedback 0.5, Energy 0.5

image

@Calinou Calinou added this to the 4.0 milestone Aug 30, 2021
@Calinou Calinou changed the title SDFGI: Indirectly lit surfaces show up black in reflections. Vulkan: Indirectly lit surfaces show up black in reflections when using SDFGI with Bounce Feedback set to 0.0 Nov 12, 2021
@Calinou
Copy link
Member

Calinou commented Jan 5, 2022

Thinking about it, this may actually be done by design. If Bounce Feedback is set to 0, then lighting will only bounce one time (as the second bounce's energy is multiplied by 0). This means there is no way for the resulting indirect lighting to show up in reflections, since it would have to bounce twice (or more) to achieve this.

#39965 will resolve this by default, but this is still something that will happen if you manually decrease Bounce Feedback to 0.

@Calinou
Copy link
Member

Calinou commented Mar 22, 2022

This is now addressed by default by #39965, closing. #59418 will also document this in case you manually decrease sdfgi_bounce_feedback to 0.0.

@Calinou Calinou closed this as completed Mar 22, 2022
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

2 participants