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

Tweak default SDFGI settings for better quality #39965

Merged
merged 1 commit into from
Feb 10, 2022

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Jun 29, 2020

  • Enable Read Sky Light to get proper outdoors lighting out of the box.
  • Set bounce feedback to 0.5 by default to get a better quality result.
  • Increase the number of frames to converge to improve quality at the cost of latency. Most scenes are fairly static after all.
  • Use 75% Y scale by default as most scenes are not highly vertical.
  • Reorder the Y scale enum to go from the lowest Y scale to the highest. Also rename the "Disabled" setting to "100%" for clarity.

Edit: This PR was amended in May 2021 to not tweak any performance-related settings. Therefore, performance should be roughly identical to what it was before. Performance tweaks were moved to #39965.

@akien-mga
Copy link
Member

Needs rebase after #40016.

@Calinou Calinou force-pushed the tweak-sdfgi-defaults branch 2 times, most recently from 0408591 to e1b5576 Compare July 1, 2020 20:08
@Calinou Calinou requested a review from a team as a code owner July 1, 2020 20:08
Copy link
Member

@clayjohn clayjohn left a comment

Choose a reason for hiding this comment

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

This will still need reduz' final approval, but it looks fine.

@ghost
Copy link

ghost commented Aug 9, 2020

i don't think this commit will help at all, there's an issue with the algorithm itself at it's core

@Calinou
Copy link
Member Author

Calinou commented Aug 9, 2020

@RaTcHeT302 The new settings definitely help in non-pathological situations. It's just that you apparently ran into a bug with SDFGI.

@aaronfranke
Copy link
Member

@Calinou What's the status of this? It seems that this is desired, but this needs a rebase before it can be reviewed and merged.

@Calinou
Copy link
Member Author

Calinou commented Feb 27, 2021

@aaronfranke reduz wasn't convinced by all of these default setting changes. I need to discuss this with him again first.

@aaronfranke aaronfranke requested review from a team February 28, 2021 16:12
@Calinou Calinou changed the title Tweak default SDFGI settings for better performance and quality Tweak default SDFGI settings for better quality May 23, 2021
@Calinou Calinou requested a review from a team as a code owner May 23, 2021 17:11
@Calinou Calinou force-pushed the tweak-sdfgi-defaults branch 2 times, most recently from c1f4c11 to 3821a80 Compare August 22, 2021 00:35
@reduz
Copy link
Member

reduz commented Aug 24, 2021

SDFGI needs further work on these areas, will work on it after Alpha

@Calinou
Copy link
Member Author

Calinou commented Aug 25, 2021

SDFGI needs further work on these areas, will work on it after Alpha

Shouldn't we enable Read Sky Light by default at least in the meantime? Right now, the SDFGI appearance on outdoor scenes isn't very appealing until you enable that property.

@FilipLundby
Copy link

Shouldn't we enable Read Sky Light by default at least in the meantime? Right now, the SDFGI appearance on outdoor scenes isn't very appealing until you enable that property.

It would be nice if it was possible to control the shadow color. When Read sky light is turned on shadows contains a lot of blue (see image 1). Turning Read sky light off makes shadows go black (see image 2).

I am aiming for a more neutral look, like image 3. I would expect the shadow color of the DirectionalLight to be the shadow color, but it doesn't seem to do anything.

The argument might be that the blueish color is more realistic and this might be true, but as a game developer I'm not always going for realism. For winter scene this would be perfect, but for warm summer day it feels out of place.

Just my two cents, other then that, it looks amazing! :)

1. Blue sky and Read sky light on
image

2. Read sky light off
image

3. Gray sky and Read sky light on
image

What the scene and sky looks like
image

@Calinou
Copy link
Member Author

Calinou commented Oct 17, 2021

It would be nice if it was possible to control the shadow color. When Read sky light is turned on shadows contains a lot of blue (see image 1). Turning Read sky light off makes shadows go black (see image 2).

In physically-based rendering, you don't adjust the shadow color. Instead, you adjust the ambient light color. To do this, reduce Sky Contribution in the Environment settings (and optionally set a plain color instead of sourcing the sky for ambient light). When doing this, Read Sky Light should be left enabled.

If the shadow appears colored, it's because the shaded area is only lit by the environment lighting (here, the sky).

I would expect the shadow color of the DirectionalLight to be the shadow color, but it doesn't seem to do anything.

Setting the shadow color is no longer supported for performance reasons. See #49447.

It would be possible to reimplement per-light shadow colors using specialization constants as was done for PCSS-like shadows, but this isn't planned for 4.0. (Specialization constants make it possible to pay the performance cost only if you use the feature in question.)

@FilipLundby
Copy link

In physically-based rendering, you don't adjust the shadow color. Instead, you adjust the ambient light color. To do this, reduce Sky Contribution in the Environment settings (and optionally set a plain color instead of sourcing the sky for ambient light). When doing this, Read Sky Light should be left enabled.

Thank you for the feedback @Calinou. I am probably missing something, because your description sounds exactly as how I set up the environment. Ambient color is set to neutral gray and ambient sky contribution is set to 0.

image

@Calinou
Copy link
Member Author

Calinou commented Nov 23, 2021

Thank you for the feedback @Calinou. I am probably missing something, because your description sounds exactly as how I set up the environment. Ambient color is set to neutral gray and ambient sky contribution is set to 0.

After checking locally, this turns out to be a (likely) bug: #55104

- Enable Read Sky Light to get proper outdoors lighting out of the box.
- Set bounce feedback to 0.5 by default to get a better quality result.
  - Higher values may cause infinite feedback with bright surfaces.
- Increase the number of frames to converge to improve quality
  at the cost of latency. Most scenes are fairly static after all.
- Use 75% Y scale by default as most scenes are not highly vertical.

- Reorder the Y scale enum to go from the lowest Y scale to the highest.
  Also rename the "Disabled" setting to "100%" for clarity.
Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

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

Approved in PR review meeting.

@akien-mga akien-mga merged commit c6199da into godotengine:master Feb 10, 2022
@akien-mga
Copy link
Member

Thanks!

@Calinou Calinou deleted the tweak-sdfgi-defaults branch February 10, 2022 16:58
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.

7 participants