File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
Source/ZetaRenderPass/Common Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -421,7 +421,7 @@ namespace BSDF
421421 {
422422 float denom = mad (whdotwo, 1 / eta, whdotwi);
423423 denom *= denom;
424- float dwh_dwi = whdotwi / denom;
424+ float dwh_dwi = denom > 0 ? whdotwi / denom : 0 ;
425425
426426 return dwh_dwi;
427427 }
Original file line number Diff line number Diff line change @@ -142,7 +142,8 @@ namespace BSDF
142142 // to 0 and the path-tracing loop is terminated.
143143
144144 ret.f = BSDF::DielectricBaseSpecularTr (surface, eval.Fr_g.x) * func_t;
145- ret.bsdfOverPdf = ret.f / ret.pdf;
145+ // if code reached here, pdf should > 0 unless dwh_dwi = 0
146+ ret.bsdfOverPdf = ret.pdf > 0 ? ret.f / ret.pdf : 0 ;
146147 ret.wi = wi_t;
147148 ret.lobe = BSDF::LOBE::GLOSSY_T;
148149 }
You can’t perform that action at this time.
0 commit comments