-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Light attenuation is incorrect in VoxelGI (values above 1.0 are too dark) #80101
Comments
Can you reproduce this with GIProbe in 3.5.2? |
Note that light attenuation in 3.x uses a different algorithm than 4.x: #44941 You can use the 4.x light attenuation formula in 3.x by enabling Use Physical Light Attenuation in the Project Settings then restarting the editor. Remember to bake GIProbe again after doing so, though I don't remember if physical light attenuation affects GIProbe. |
I tested in Godot 4 with that option and it worked, although range and Intensity still have a "clamped" functionality, and by clamped I mean that the intensity lumens actually controls the range and intensity. So the parameters range and intensity act more like a "mix factor". |
I was referring to an option which does not exist in Godot 4: physical light attenuation, not physical light units 🙂 |
Any updates on this? It still doesn't work in 4.4 dev3 |
I've taken a look at the code that updates VoxelGI lighting and couldn't find anything of note. |
It would seem, that removing the attenuation check in line 281 from the file you linked fixes VoxelGI completely cutting off light, that should propagate otherwise. - if (attenuation < 0.01 || (length(normal) > 0.2 && dot(normal, light_dir) >= 0)) {
+ if ((length(normal) > 0.2 && dot(normal, light_dir) >= 0)) {
return false; //not facing the light, or attenuation is near zero
} This is the testing setup without VoxelGI and with attenuation This is with VoxelGI currently (note that there is no difference at all): The same setup after removing the check: For reference, here's the same setup with SDFGI enabled (default config): Another reference - attenuation Removing the check, from my understanding, might degrade performance due to computing lighting that might actually have near zero attenuation. On the other hand, changing it to a lower value, e.g. When compared to SDFGI, you can clearly tell that there is a huge difference between how attenuation is computed for VoxelGI. |
Godot version
v4.1.stable.official [9704596]
System information
Godot v4.1.stable - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1050 Ti (NVIDIA; 31.0.15.3598) - Intel(R) Xeon(R) CPU E3-1230 V2 @ 3.30GHz (8 Threads)
Issue description
Light attenuation greatly affects VoxelGI, way more than it should, depending on the value it won't even show up, neither increasing the range solves it:
Light attenuation set to 3.14
Light attenuation set to 1.0
Steps to reproduce
Add any kinds of 3D light, set the attenuation to a value bellow 1 and it will start showing up incorrectly, range and intensity will start to have no effect over the light, and it will have a hard cut
Minimal reproduction project
VoxelGIAttenuation.zip
The text was updated successfully, but these errors were encountered: