Jump to content
ranw0477

Relation between volume quality and stochastic sample?

Recommended Posts

Hi awesome guys on odforce,

I am currently trying to optimize my volume render and I am a bit confused what is the relationship between volume quality and stochastic samples? How they contribute to the final sample beings send on the volume? How should I balance them? Any ideas are welcome! 

Edited by ranw0477

Share this post


Link to post
Share on other sites

here's my understanding:

volume quality relates to the number of samples created along the path of the ray.  at ray quality 1, the volume is sampled once for each voxel along the camera ray.  at .25 it's sampled roughly once every 4 voxels.  since it's along the camera ray, it's not very noticeable really, until you get very low.  the result is that you have fewer transparency calculations along your ray since you have fewer intersections with your volume.

stochastic sampling is a modified screen-door technique applied to all transparency (not just volumes).  the idea with stochastic transparency isn't to reduce the number of ray intersections, the idea is to stop the path tracer early for some rays.  so what it does it to treat some portion of your shading samples as opaque, even if they're partially transparent.  i'm a bit vague on how the actual samples number is utilized other than more gives better results.

i tend to not mess too much with volume quality.  usually you try the lowest stochastic samples you can get away with.  if you're ray tracing shadows in your volume, i would suggest you increase ray samples and turn off ray variance.

 

Edited by fathom

Share this post


Link to post
Share on other sites

I'd like clarification on this, but by enabling stochastic, I believe that you are telling mantra to split off the opacity sampling from how it would have been sampled without stochastic enabled (which would be along with the uniformly-lengthed volume quality sampling) -- So this means that it now has to calculate opacity much less frequently (from 1 to whatever your stochastic set to), and speeds up the render. That is why by enabling stochasic, it instantly makes the render more 'noisey' (or more randomly scattered opacity sampled). Just from intuition, I'd guess the values you plug in the stochastic parm are multiplicative, like the volume quality.

Share this post


Link to post
Share on other sites

documentation states that quite clearly:

"Stochastic transparency samples - The number of transparent samples to be shaded as a ray travels through translucent objects. Increasing this value will result in less noise in translucent objects and is generally less costly than increasing Pixel samples, Volume Quality, or Min and Max ray samples. Stochastic Sampling will not have any effect on noise from Indirect Sources however. This may make the image noisier than without stochastic transparency, so you may need to compensate by, for example, increasing the pixel samples. You should generally leave this option on."

So to answer your question, there is no direct relation. Volume quality is related to the volume resolution and Stochastic sampling is related to the image sampling quality. In many cases it can help to render volumes faster (when the noise is coming mostly from transparency) but if you are getting the noise mostly from indirect samples (like volume bounce), you may want to turn this off because you need to crank up the pixel samples anyway.

The thing what fathom was talking about, the one with terminating a transparent samples early, is called Opacity Limit. That can speed up your render dramatically but it may suffer from reduced accuracy (especially with thin volumes). Usually you don't want to change this setting unless the speed is your main concern.

 

Share this post


Link to post
Share on other sites

Please take a look at this video starting at 1 min. Andrew explains it very nicely

Cheers,

Koen

 

 

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×