-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
LightmapGI: Use Geomerics technique for retrieving irradiance from SH #101141
base: master
Are you sure you want to change the base?
LightmapGI: Use Geomerics technique for retrieving irradiance from SH #101141
Conversation
I wonder if this technique would make it easier to implement specular lobes for directional lightmaps, as I mentioned in #63016 (comment). |
Testing this PR rebased on top of Edit (2025-02-10): Updated screenshots to fix overly saturated lightmap colors since #102203 was fixed. BeforeAfterThe directional aspect looks much closer to real-time lighting now 🙂 This appears to work well to address #102300 too, seeing the directional lightmap's brightness now better matches the non-directional one. |
Does this fix or improve this? #63016 |
No, this should be implemented separately. I've attempted to implement this in a branch but didn't get it working correctly yet: https://github.com/Calinou/godot/tree/lightmapgi-directional-draw-direct-specular-lobes |
I've updated screenshots to match |
@Calinou are you sure you updated the images? I still see the issue in your images. In the static directional, you can see the bottom of the image darker than the non-directional or the real time. I think this issue was fix on master with #102424 The image in that PR doesn't exhibit the darker area in the directional static |
Yes, check the comment's edit history (in the top-right corner of the comment) to see the previous images. They were oversaturated, but the new ones aren't. However, I initially didn't understand what you were pointing. I didn't notice the darkening in the middle of the image. |
Changes the way directional lightmaps are calculated by using the technique described in https://web.archive.org/web/20160313132301/http://www.geomerics.com/wp-content/uploads/2015/08/CEDEC_Geomerics_ReconstructingDiffuseLighting1.pdf
This implementation is based on https://github.com/kayru/Probulator/blob/4a97a2b021eb2ca7ef696f4ddf36ba9a9432cbb6/Source/Probulator/SphericalHarmonics.h#L136-L151
Calculating SH lighting this way has several benefits, namely it avoids overdarkening caused by the resulting irradiance being negative, as well as enhances the contrast in the colors.
Results:
Issues:


The contrast seems too high, probably due to incompatibility in the coefficients,
Dimly lit or completely occluded areas exhibit significant artifacting:
TODO: