How to get the exit point of a refracted ray? #313
-
Hi, I am trying to implement a custom plugin in Mitsuba 3 for a dielectric material. I would like to determine that in the event of refraction at what point the ray is exiting the surface and also the normal at that point. I was looking at the sample BSDFs for dilelectric and rough dielectric surfaces which simply determine the exiting direction wo using the refract() function. Besides wo, I am also in need of the point and normal of where it exits the surface. One alternative that can still work is if there is a way to sample a random point and normal on the surface inside the BSDF sample() function and set that as the exiting direction after transmission and multiple TIRs. The point is needed to (i) get diffuse and specular colors at exit point (ii) attenuate the ray through the medium based on distance between entry and exit point. If someone can help me with either of these ideas, then it will be hugely appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @apoorvkhattar, The BSDF models assume the entry and exit points are colocated. If I understood correctly, in your case you would like to compute a exit point that is different from the entry point, within the BSDF plugin? To me this sounds more like something that should be implemented in the integrator plugin directly. |
Beta Was this translation helpful? Give feedback.
Hi @apoorvkhattar,
The BSDF models assume the entry and exit points are colocated. If I understood correctly, in your case you would like to compute a exit point that is different from the entry point, within the BSDF plugin? To me this sounds more like something that should be implemented in the integrator plugin directly.