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

Add minimum roughness project setting to improve VoxelGI/SDFGI performance #63468

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Jul 25, 2022

Related to #56804.

The roughness will be clamped for the purposes of VoxelGI and SDFGI rendering. This avoids rendering sharp reflections, which are very demanding when taking significant portions of the screen.

Other sources of reflection such as ReflectionProbes and environment sky aren't affected.

This closes godotengine/godot-proposals#4811 and partially addresses godotengine/godot-proposals#3012.

Testing project: test_gi_opt.zip

Benchmark (using testing project)

Note that the test scene only uses smooth materials, so the performance gain demonstrated here is greater than it would be in a typical real world scene.

OS: Fedora 36
GPU: GeForce GTX 1080 (NVIDIA 510.68.02)
Resolution: 2560×1440

No GI

For reference purposes.

306 FPS (3.27 mspf)

VoxelGI only

VoxelGI min. roughness Performance
0.0 170 FPS (5.88 mspf)
0.1 171 FPS (5.84 mspf)
0.2 181 FPS (5.52 mspf)
0.3 186 FPS (5.37 mspf)
0.4 195 FPS (5.12 mspf)
0.5 198 FPS (5.05 mspf)
0.6 200 FPS (5.00 mspf)
0.7 202 FPS (4.95 mspf)
0.8 204 FPS (4.90 mspf)
0.9 206 FPS (4.85 mspf)
1.0 208 FPS (4.81 mspf)

SDFGI only

Note: The sudden increase in performance at 0.2 is due to all sharp reflections being disabled within the SDFGI shader.

SDFGI min. roughness Performance
0.00 122 FPS (8.20 mspf)
0.02 124 FPS (8.06 mspf)
0.04 125 FPS (8.00 mspf)
0.06 127 FPS (7.87 mspf)
0.08 128 FPS (7.81 mspf)
0.10 130 FPS (7.69 mspf)
0.12 132 FPS (7.58 mspf)
0.14 134 FPS (7.46 mspf)
0.16 135 FPS (7.41 mspf)
0.18 136 FPS (7.35 mspf)
0.20 166 FPS (6.02 mspf)

VoxelGI + SDFGI

Min. roughnesses Performance
VoxelGI: 0.0, SDFGI: 0.00 96 FPS (10.42 mspf)
VoxelGI: 0.1, SDFGI: 0.02 97 FPS (10.31 mspf)
VoxelGI: 0.2, SDFGI: 0.04 101 FPS (9.90 mspf)
VoxelGI: 0.3, SDFGI: 0.06 105 FPS (9.52 mspf)
VoxelGI: 0.4, SDFGI: 0.08 108 FPS (9.26 mspf)
VoxelGI: 0.5, SDFGI: 0.10 110 FPS (9.09 mspf)
VoxelGI: 0.6, SDFGI: 0.12 111 FPS (9.00 mspf)
VoxelGI: 0.7, SDFGI: 0.14 113 FPS (8.85 mspf)
VoxelGI: 0.8, SDFGI: 0.16 115 FPS (8.70 mspf)
VoxelGI: 0.9, SDFGI: 0.18 117 FPS (8.55 mspf)
VoxelGI: 1.0, SDFGI: 0.20 138 FPS (7.25 mspf)

@clayjohn
Copy link
Member

I like the idea! Let's reevaluate performance after reduz updates SDFGI and see if this still has the same benefit.

@jcostello
Copy link
Contributor

I like the idea! Let's reevaluate performance after reduz updates SDFGI and see if this still has the same benefit.

Is this going to happen in the beta phase?

@Calinou
Copy link
Member Author

Calinou commented Jul 27, 2022

Is this going to happen in the beta phase?

Yes 🙂

@Calinou Calinou force-pushed the sdfgi-voxel-gi-add-min-roughness-setting branch from 767fd61 to fe3cbba Compare August 1, 2022 15:27
@reduz
Copy link
Member

reduz commented Aug 11, 2022

This is very hacky because SDFGI switches from sphere tracing to using the probes at a given angle, so at much that should be disabled directly. If you get the value wrong, it will be random when you fall into the sphere tracing range.

I think this should be done different. In fact, for the rewrite I want to make, I want to use a different way to do roughness when TAA is in use that should be a bit faster.

@Calinou Calinou force-pushed the sdfgi-voxel-gi-add-min-roughness-setting branch from fe3cbba to 2a5578d Compare October 3, 2022 22:11
@jcostello
Copy link
Contributor

@Calinou what is the update here?

@Calinou
Copy link
Member Author

Calinou commented Oct 3, 2022

@Calinou what is the update here?

Just a rebase – nothing else is included. Note that this PR won't be merged as-is (see reduz's comment above). I'm only keeping it updated for reference purposes.

…mance

The roughness will be clamped for the purposes of VoxelGI and SDFGI
rendering. This avoids rendering sharp reflections, which are very
demanding when taking significant portions of the screen.

Other sources of reflection such as ReflectionProbes and environment
sky aren't affected.
@Calinou Calinou force-pushed the sdfgi-voxel-gi-add-min-roughness-setting branch from 2a5578d to d036c29 Compare January 29, 2023 23:46
@akien-mga akien-mga modified the milestones: 4.0, 4.x Jan 30, 2023
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.

Allow user to prefer SDFGI reflections when both VoxelGI and SDFGI are used
5 participants