- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 23.5k
 
LightmapGI: Pack L1 SH coefficients before denoising #109972
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
base: master
Are you sure you want to change the base?
Conversation
| 
           Seems that directional data is preserved and works just fine with OIDN. It fixed the issue of losing directional data when denoising with OIDN  | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally, it works as expected. Code looks good to me.
However, JNLM now has a tendency to darken bright static lights, as seen below. This doesn't happen with OIDN.
Testing project: test_pr_109972.zip
| No denoiser | JNLM before | JNLM after | 
|---|---|---|
![]()  | 
![]()  | 
![]()  | 
| OIDN before | OIDN after | "Ground truth"1 | 
|---|---|---|
![]()  | 
![]()  | 
![]()  | 
Footnotes
- 
Ultra quality, supersampling
2.0, no denoising ↩ 
          
 This can probably be fixed by adjusting the denoiser strength, since the directional data is now packed that value can be a constant. The L0 coefficient has 1/4 the brightness of a non-directional lightmap, so an adjustment may be necessary there as well.  | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me
| 
           @BlueCube3310 Should we go ahead and merge this, or did you want to poke at the JNLM issue first?  | 
    
          
 I'll attempt to fix the issue first  | 
    
fc9c75f    to
    be25520      
    Compare
  
    | 
           The L0 light weights are now multiplied by 4 to ensure the directional lightmap has the same influence as a regular one. Additionally, the L1 coefficients now use the weights from the L0 layer. I've also fixed a bug that caused shadowmasks to be unnecessarily denoised 4 times when baking with both them and directional enabled. CC @Calinou could you confirm whether this fixes the JNLM denoising? (I'm no longer able to download the linked MRP)  | 
    
be25520    to
    64cb1e7      
    Compare
  
    





Modifies the code that handles denoising to always pack the L1 coefficients first, then denoise the directional lightmaps. This slightly improves quality and eliminates errors that occur due to dealing with negative color values.
TODO: