Is it possible to get the distance the current ray has travelled?
I'm looking into doing something similar to this:
http://magnuswrenninge.com/wp-content/uploads/2010/03/Wrenninge-OzTheGreatAndVolumetric.pdf [magnuswrenninge.com]
where they have a nice way of simulating multiple scattering in volumes by varying some parameters along the shadow ray.
Shadow ray distance (in volumes)
1821 2 0- simonekeberg
- Member
- 4 posts
- Joined: July 2013
- Offline
- edward
- Member
- 7727 posts
- Joined: July 2005
- Online
- jparker
- Member
- 293 posts
- Joined:
- Offline
I'm interested in this as well, but my rusty reading of the equation implies that they modify the shadow in a loop, calling the phase function multiple times, and lowering the shadow volume density in each iteration.
The only simple way I can think to do this using PBR is to evaluate the henyey greenstein F value for each octave, modifying the parameters and summing the result. It's slow and a little inflexible, however, because in pure PBR mode one can't modify the shadow opacity per-BSDF. So you have to do it in a loop and evaluate the BSDF multiple times. Someone please correct me if I'm wrong about that.
That's always annoyed me about the PBR implementation, having the F*Of black-boxed… I suppose if you wanted, you could hack the pathtracer code to somehow allow this, though.
I made a quick hack of it, see the attached HIP.
The only simple way I can think to do this using PBR is to evaluate the henyey greenstein F value for each octave, modifying the parameters and summing the result. It's slow and a little inflexible, however, because in pure PBR mode one can't modify the shadow opacity per-BSDF. So you have to do it in a loop and evaluate the BSDF multiple times. Someone please correct me if I'm wrong about that.
That's always annoyed me about the PBR implementation, having the F*Of black-boxed… I suppose if you wanted, you could hack the pathtracer code to somehow allow this, though.
I made a quick hack of it, see the attached HIP.
-
- Quick Links