Ah, this is my oversight.
In main the logic of direct_light_sampling_type
is that whichever option you set, it should converge to the same result. So even if you choose forward sampling and the…
I removed the # ifdef __HAIR__
case here. It should be fine to check (sd->type & PRIMITIVE_TRIANGLE)
even when __HAIR__
is not defined?
I did not test this PR thoroughly, just had a first pass. I believe some points in you PR description is outdated, please update them.
WI think we could default to the IOR of water, which is 1.33.
I believe we should trust fresnel_dielectric_polarized()
instead of checking TIR before calling the function.
This function is almost identical as fresnel_dielectric()
except for the phase computation, would it be practical to reuse that function? The phase computation could then be:
ls->t
not written
t
and P
not written
restir.h
and reservoir.h