Jump to content

How to optimize simple volume rendering


Recommended Posts

Hi guys,

 

I know this topic has been discussed all over the forums already, but lot's of the information is really old and so I wanted to ask you some questions (I'm still on H14 unfortunately...) 

I am totally fine with short answers (or up-to-date links) in case you are bored of that topic ;)

 

1. What's the best way to get rid of noise around light sources. I know Arnold and (maybe also) VRay have clever ways to sample in those areas. Does mantra have such an optimization somewhere?

2. Am I really just left with pixel samples,volume quality and stochastic samples? Or is there a hidden speed-up somewhere?

3. I have a volume that has just a density field and I am wondering if there is a quick and easy shader to render this instead of throwing a full-blown pyro shader at it. will the pyro code be optimized (compiler wise) before the render or should I rather build my own lightweight shader? If yes, what would be a good base to start with?

4. What would be the values to tweak if I go for micropoly volume rendering? Stochastic samples don't work anymore as far as I have read today. 

5. is micropoly always faster in volumes? (i am not planning on using indirect volume lighting)

 

thx in advance guys!

Oli

Link to comment
Share on other sites

Probably the best current answer is to use Octane. 

 

Within Mantra, Constant Smoke is the quickest and least featured, you can use a low sample rate too.

 

Edit: Avoid Env lights too.

 

Edit2: convert the volume to VDB - it was 30% or so faster than standard volumes.

Edited by tar
Link to comment
Share on other sites

well i am no mantra expert and this might be a bad idea ... :)

 

but i tend to keep the same practice as in Mental Ray by keeping my pixel sample very low like 2 * 2 / 3 * 3 and just push the min ray sample to balance this.

- deep shadow

- micro PBR

- no stochastic

- very low pixel sample

- pushing a little the min samples

is generally what i use when i have very few times but it might be a little old school for your needs ... 

  • Like 2
Link to comment
Share on other sites

for pbr, i tend to go with high pixel samples and no extra ray samples -- ie, 9x9 pixels, 1 min ray, no variance aa.  stochastic transparency i usually try to keep lowish (1 if i can, but maybe up to 4-8 if needed).  the theory being the primary samples are more important the secondary samples for volumes.

 

for normal smoke, i usually use the "billowy smoke" shader.

 

it's also worth trying micropoly vs pbr.  sometimes one is faster than the other... haven't really found a consistent winner.  likely depends a lot on what's in your scene.

  • Like 2
Link to comment
Share on other sites

Miles thanks for the tricks i have never try to render my fluids with fix sampling i'm gonna investigate that ...

What do you think about deep vs raytrace shadows ? what do you use to get the shortest rendertimes ?

 

each times i use stochastic it introduces lot of noise in the image ... what i am doing wrong ?

 

Thanks again for your advise !

 

Cheers 

 

E

Edited by sebkaine
Link to comment
Share on other sites

when you say fluids, you mean volumes still, yeah?  not like meshed surfaces...

 

i don't tend to use deep shadows a whole lot.  i just bite the bullet and do raytraced.  maybe that's why i end up needing to drop the secondary rays down so far...

 

if you don't have a lot of primary rays, then stochastic transparency should probably be higher.  figure your overall number of samples in your volume will be (at most) your pixel samples times your stochastic samples.  so 3x3 with 4 stochastic samples is 9x4 or 36 voxel samples at most.  which might equate to an unacceptable amount of noise depending on the nature of your volume.  if you have 1/9 variance sampling, each of those 36 primary ray intersections will fire off multiple secondary rays for shadow calculations (if it's ray tracing shadows) -- like in the upper values.  which seems to be overkill for lighting when the bigger problem is your alpha.

 

9x9 with 1 stochastic sample is 81 samples.  and if i don't do variance sampling, each of those samples sends out a single ray when it comes to shadow calculations so there's a better primary ray to secondary ray ratio.

 

 

at least, that's my working theory.  :)

  • Like 3
Link to comment
Share on other sites

Hi guys,

 

thanks a lot for your insight and I think I will need to go the shadow-map route (my current rendertime is ~7hours on a 6-core i7)

 

I have 14 bright area lights in my scene. Do I have to do anything else besides switching to deepshadows and tweak the resolution or is there something more fancy needed for arealights(single-sided)?

 

Also nobody answered my question about getting rid of noise when getting close to the lightsource. Is there no optimization?

 

cheers and thanks again!

Oli

Edited by Oliver Markowski
Link to comment
Share on other sites

not sure if you can do shadowmaps with area lights.  it'd be an interesting experiment.  the noise in your light may simply be undersampling the density of the volume or it might be undersampling the lighting contribution of each light... hard to know really without trying different tuning parms.

 

are you increasing the quality on your lights?  that will effectively multiply the number of samples for your lighting calculations...

Link to comment
Share on other sites

i dont't know if this could work in your case, but you could shoot an animated 16 float hdr of your scene from your center volume POV.

and then only use this as a raytraced background.

 

i do this to match maxwell render and mantra volume, and it works fine. basically i store my maxwell lighting inside one map by shooting a 360 HDR.

basically you do what HDR Light Studio do so you will have 14 bright area on your map corresponding to your 14 lights.

But you light your fluid with only one env map.

 

again old school but good enough in many case.

Edited by sebkaine
Link to comment
Share on other sites

Looking at the Stalingrad video at https://www.sidefx.com/index.php?option=com_content&task=view&id=2692&Itemid=68they have polygon geometry enclosing the big scale smoke pillars. I'm quite sure that is an optimization for skipping empty space ray marching, but I haven't really spent the time to figure out how they do that. Must be worth the trouble with clearly defined smoke shapes that only fill a small part of their bounding boxes, otherwise they wouldn't have implemented it..

 

Oh how many times I must have watched that video.

Link to comment
Share on other sites

Looking at the Stalingrad video at https://www.sidefx.com/index.php?option=com_content&task=view&id=2692&Itemid=68they have polygon geometry enclosing the big scale smoke pillars. I'm quite sure that is an optimization for skipping empty space ray marching, but I haven't really spent the time to figure out how they do that. Must be worth the trouble with clearly defined smoke shapes that only fill a small part of their bounding boxes, otherwise they wouldn't have implemented it..

 

Oh how many times I must have watched that video.

I thought it could be some sort of projection in comp, or maybe just for visualisation. But you could be right, in that case its very interesting indeed.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...