Total refraction bounces as surface color

Recommended Posts

I understand the refract function returns a refraction vector. The refractlight function returns a color. I would like to store the number of refraction bounces as the final surface color, or perhaps the length the ray traveled. Can anyone help me understand how this works for multiple bounces?

Share this post

Link to post

Share on other sites

Awesome thanks for that! Can anyone post a snippet of code for multiple bounce refraction? Say I had an complex surface that had multiple refractions and I wanted to know the distance that the 6th ray bounce traveled. I'm assuming I would have to handle this with the rayhittest()?