-
Hi, I'm new to Mitsuba, so my question might be basic. I'm currently trying to implement my own BSDF in Mitsuba's spectral mode. As far as I know, in spectral mode, the refractive index varies across different wavelengths. While working on my implementation, I noticed that Mitsuba samples four wavelengths at a time. Although the BSDF returns a spectral quantity with four values, it still uses a single BSDFSample3f object, which contains fields like wo and pdf. These fields can depend on the wavelength. My question is: how does Mitsuba internally handle the fact that direction (wo) and pdf are shared across multiple wavelengths, even though the BSDF evaluation depends on wavelength-specific behaviour like refractive index? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @shiasin
That is correct. However, FWIW I believe we don't model this in any of the existing materials.
The solution to this, is to build one single geometric light path and evaluate it for 4 different wavelengths. Of course, with something like an ideal dielectric with a spectral-varying refractive index, there is only a single valid outgoing direction (wo) per wavelength. In practice, this would mean that you're wasting 3/4 of your computation -- the 3 other wavelengths will have 0 contribution for the selected (wo). But for "smooth" materials, we can still sample a single direction and evaluate the BSDF contribution for all 4 of them. This is known as hero-wavelength sampling. |
Beta Was this translation helpful? Give feedback.
Hi @shiasin
That is correct. However, FWIW I believe we don't model this in any of the existing materials.
The solution to this, is to build one single geometric light path and evaluate it for 4 different wavelengths. Of course, with something like an ideal dielectric with a spectral-varying refractive index, there is only a single valid outgoing direction (wo) per wavelength. In practice…