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
421
421
{
422
422
float denom = mad (whdotwo, 1 / eta, whdotwi);
423
423
denom *= denom;
424
- float dwh_dwi = whdotwi / denom;
424
+ float dwh_dwi = denom > 0 ? whdotwi / denom : 0 ;
425
425
426
426
return dwh_dwi;
427
427
}
Original file line number Diff line number Diff line change @@ -142,7 +142,8 @@ namespace BSDF
142
142
// to 0 and the path-tracing loop is terminated.
143
143
144
144
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 ;
146
147
ret.wi = wi_t;
147
148
ret.lobe = BSDF::LOBE::GLOSSY_T;
148
149
}
You can’t perform that action at this time.
0 commit comments