Hello,
I've been looking at the calc_opacity subnet in the basic flame shader, but don't really understand what's going on.
It seems Of = 1-exp(-density*dPdz)
What exactly is dPdz ? It says “change in position with depth”, but what does it mean ?
I've heard a bit about raymarching, but I don't see any sum along the ray going on here.
Does mantra takes care of it, knowing it is shading a volume primitive ?
Thanks for any help, I got interested in shading recently and i'm a bit curious about this.
Vincent
Volume shader explanation ?
6576 2 1-
- vinz
- Member
- 113 posts
- Joined: Dec. 2007
- Offline
-
- andrewc
- Member
- 1002 posts
- Joined: July 2005
- Offline
Mantra's volume primitives get split up and shaded much like standard surface primitives. In the case of volumes, the shader is responsible for shading a segment of volume of length dPdz - the volume step size.
The opacity calculation converts density to the opacity for this distance through the volume. There may be other parts of the volume in front and behind the part that you're shading, mantra will automatically handle the raymarching and compositing order for these segments.
Andrew
The opacity calculation converts density to the opacity for this distance through the volume. There may be other parts of the volume in front and behind the part that you're shading, mantra will automatically handle the raymarching and compositing order for these segments.
Andrew
-
- vinz
- Member
- 113 posts
- Joined: Dec. 2007
- Offline
-
- Quick Links

