Closed MaximilianBader closed 2 years ago
Hi @MaximilianBader ,
I would suggest you take a close look at the bsdf.h header file. The docstring of the different methods clearly explain how this cosine term is handled in Mitsuba.
In some BSDF implementation you might not be able to find this term as it cancels out somehow in the math, hence doesn't need to be computed explicitly.
Hi @Speierers,
@GuillaumeZahnd and me would like to thank you for the quick response and the help you provided! We will check out the bsdf.h header and look into the theory again afterwards.
Summary
Problems to locate the scaling factor
cos(theta)
to compute thethroughput
inpath.cpp
.Description
@GuillaumeZahnd and me are trying to relate the implementation of
path.cpp
with the theory provided in the PBR book (https://pbr-book.org/3ed-2018/Light_Transport_I_Surface_Reflection/Path_Tracing). It is clear to us, that to updatethroughput
for each surface interaction in a path iteration, it has to be scaled withbsdf_val*cos(theta)
(https://github.com/mitsuba-renderer/mitsuba2/blob/master/src/integrators/path.cpp#L176). Checking the implementation, we concluded, the scaling withcos(theta)
is already included inbsdf->sample(...)
(line 177). When we look at the implementationroughDielectric::sample()
, we can see the scaling in line 304 withdot(si.wi, m)
(https://github.com/mitsuba-renderer/mitsuba2/blob/master/src/bsdfs/roughdielectric.cpp#L304) of the implementation. However, when checking the implementationSmoothDielectric::sample()
, we were not able to locate where this scaling is executed (https://github.com/mitsuba-renderer/mitsuba2/blob/master/src/bsdfs/dielectric.cpp#L201).Could you elaborate, how the scaling with
cos(theta)
is included in the computation? We're definitely missing something crucial here, but we have not been able to figure it out ourselves.Thanks a lot in advance!