Skip to content

Commit

Permalink
Fix thin glass problem
Browse files Browse the repository at this point in the history
  • Loading branch information
teachmain committed Oct 16, 2024
1 parent aeec9de commit 84e83ca
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions zenovis/xinxinoptix/DisneyBSDF.h
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,9 @@ namespace DisneyBSDF{
} else {
if(thin)
{
vec3 t = sqrt(mix(mat.transColor, mat.diffractColor, mat.diffraction)) * glassWt;
float tmpPdf = (reflectance==false)? 0.0f:1.0f;
vec3 t = sqrt(mix(mat.transColor, mat.diffractColor, mat.diffraction)) * glassWt / (1e-6+abs(wi.z));
float F = BRDFBasics::DielectricFresnel(abs(wo.z), entering?mat.ior:1.0/mat.ior);
float tmpPdf = reflectance ? (1.0f-F) : 0.0f;
t = t * (tmpPdf>0.0f?1.0f:0.0f);
tterm = tterm + t;
f = f + t;
Expand Down

0 comments on commit 84e83ca

Please sign in to comment.