-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
Added radiance when using clear color #27898
Conversation
0070585
to
05ab49d
Compare
I just added another change to this. I moved the computation of the environment brdf to the beginning where the radiance map is read from. A term that should have only applied to the environment was being used to scale the entire brdf, resulting in much darker rough metals. |
@akien-mga i can split this up into two PRs. The background color stuff should not break compatibility. And the PBR correctness part can wait for 4.0 if we are worried about breaking projects. Although the difference is very subtle. |
This should be left as-is I think. The current implementation is very confusing and this will most likely make it worse (It will break compatibility and users will be clueless about how to fix it, since previous behavior will not be possible anymore). For Godot 4, my plan is to separate the sources for indirect irradiance and reflections, so it would be more obvious what's going on. |
As discussed on IRC today, there are some concerns on the impact this may have on existing projects. Yet it's also a clear bugfix, so the plan is to merge it, ask people to test the master branch on their projects, and assess anything that could be consider problematic in those projects. Some changes needed based on today's review before merging, though. |
As per meeting discussion I will move the environment scaling to 1628 in GLES2 and to 2025 in GLES3 |
2dcfb16
to
5c25209
Compare
Thanks! |
Before when using a background other than sky, when
METALLIC
was greater than zero the mesh rendered black. Now, it takes into account background color when not using an environment map (not using sky).before
after
Note: if our PBR implementation was perfectly energing-preserving, this sphere should be perfect white, but it is not. I'm going to look into that for a further PR, we should be able to approximate multi scattering and make our specular function closer to energy preserving.
Fixes: #27888