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

Allow using between 1 and 8 cascades for SDFGI #56761

Merged

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Jan 13, 2022

Related to #39965 (can be merged independently).

This provides more flexibility between performance and quality adjustments, especially when using SDFGI for small-scale levels (which can be useful for real-time procedurally generated scenes).

Testing project: test_sdfgi_num_cascades.zip

Preview

Look at the FPS counter in the top-right corner.

6 cascades

2022-01-13_19 38 59

5 cascades

2022-01-13_19 39 04

4 cascades

2022-01-13_19 39 11

3 cascades

2022-01-13_19 39 15

2 cascades

2022-01-13_19 39 22

1 cascade

Since GI would end really up close with a cell size of 0.4, I manually increased the cell size to 0.6.

2022-01-13_19 43 03

SDFGI disabled

2022-01-13_19 43 13

1 cascade + half-resolution GI + 8 SDFGI rays

The lowest-end possible setting. Only takes 0.5 ms of GPU time on a GTX 1080. Should be usable on recent or high-end integrated graphics.

2022-01-13_19 43 19

@mrjustaguy
Copy link
Contributor

mrjustaguy commented Jan 13, 2022

This is really great, 4 cascades Stuttered on Low end GPUs during movement, while 1-2 don't. Thanks for this change!

Also, Just setting to 1 Cascade and going to a Large cell size, like 8,16 or such (to have SDF for the entire View) adds a significant improvement to overall quality without much of a performance hit as opposed to the previous minimum, albeit adding a bit Light Leaking (however even disabling most lights from GI totally would fix this while still improving quality)

@clayjohn clayjohn requested a review from reduz January 14, 2022 05:49
@clayjohn
Copy link
Member

Looks good to me too! I'm surprised how good the quality is with just one cascade. How does it look in motion?

@mrjustaguy
Copy link
Contributor

Just fine, same as static really... now with pair this with 1 frame for converging and it could be a fun effect.. I mean it isn't a very strong "GI" effect that way, but it is an interesting and good looking effect that way.

It would be interesting to see how this would work if you could increase the size of a Cascade without affecting cell size..

@Calinou
Copy link
Member Author

Calinou commented Jan 14, 2022

How does it look in motion?

In motion, SDFGI fade-in is quite noticeable indoors by default (but it's OK outdoors):

sdfgi-1-cascade-fade_.mp4

However, you can improve the appearance of indoor SDFGI fade-in (at the cost of outdoor appearance) by exploiting the fact that Environment ambient light settings can be adjusted independently of SDFGI ambient light settings.

Here's an example with Sky Contribution decreased to 0.25. Indoor fade-in becomes much less noticeable, but outdoor appearance is worse:

sdfgi-1-cascade-fade-low-sky-contribution_.mp4

In outdoor scenes, fog can be used to make SDFGI fade-in less noticeable. If you are OK with having coarser GI, you can also increase Min Cell Size to increase the area covered by SDFGI.

@clayjohn
Copy link
Member

Looks much better than having no GI to me! Even in motion!

This provides more flexibility between performance and quality
adjustments, especially when using SDFGI for small-scale levels
(which can be useful for procedurally generated scenes).
@Calinou Calinou force-pushed the sdfgi-allow-any-number-of-cascades branch from 50334e7 to 2dc7b03 Compare January 17, 2022 15:49
@akien-mga akien-mga merged commit 01eefa2 into godotengine:master Jan 18, 2022
@akien-mga
Copy link
Member

Thanks!

@Calinou Calinou deleted the sdfgi-allow-any-number-of-cascades branch January 18, 2022 15:44
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.

4 participants