Author Topic: Volumetric optimisations  (Read 843 times)

2025-01-31, 12:19:21

Jpjapers

  • Active Users
  • **
  • Posts: 1711
    • View Profile
Are there any settings i can tweak on volumetric-heavy scenes to speed up render times?

I have a very foggy and dusty scene using volumetric materials, volume grids and VDBs. No global volume material.
Ive adjusted step size (I feel that the documentation on this could feature larger scale examples) but is there anything 'under the hood' that can help?

2025-02-01, 12:48:36
Reply #1

Nejc Kilar

  • Corona Team
  • Active Users
  • ****
  • Posts: 1322
    • View Profile
    • My personal website
Hmm, the only other things besides the step size that I can think of right now would be messing with the GI vs AA balance and or changing the MSI to something like 1 (although of course that'll clip the intense rays a bit so it means less realism).
Nejc Kilar | chaos-corona.com
Educational Content Creator | contact us

2025-02-01, 13:16:09
Reply #2

lollolo

  • Active Users
  • **
  • Posts: 256
    • View Profile
+1
I also think that step size could be better explained with a few examples. I still don't understand what exactly step size means and does.

2025-02-01, 13:39:17
Reply #3

Tom

  • Active Users
  • **
  • Posts: 307
    • View Profile
    • www
@lollolo

I guess the step size is the size of the voxels, meaning it reflects the acuracy of the volume.

2025-02-03, 14:56:17
Reply #4

TomG

  • Administrator
  • Active Users
  • *****
  • Posts: 5961
    • View Profile
Yep, Tom is correct. Basically it's how far to "jump through" the material before sampling another point in the volume. So if you have a volume 1m thick, a step size of 20cm will take 5 samples throughout that volume (missing any details in variation of the volume that are smaller than 20cm), or a step size of 10cm will take 10 samples, catching more variation in the volume so is more accurate, but of course takes twice as long to do (say) since it is twice the number of samples. In this example, a step size of 120cm would only take one sample when it first intersects the volume, as the next step of 1.2m takes it outside the 1m volume, so you are back to "on surface" mode again really :)
Tom Grimes | chaos-corona.com
Product Manager | contact us

2025-02-03, 15:52:02
Reply #5

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 9149
  • Let's move this topic, shall we?
    • View Profile
    • My Models
So if you have a volume 1m thick, a step size of 20cm will take 5 samples throughout that volume (missing any details in variation of the volume that are smaller than 20cm), or a step size of 10cm will take 10 samples, catching more variation in the volume so is more accurate, but of course takes twice as long to do (say) since it is twice the number of samples.

Shouldn't it be more like 8 times longer, since we're talking about volume here? Never tried to measure actual difference, since i don't use much volumetrics if at all. Just curious.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2025-02-03, 16:43:46
Reply #6

TomG

  • Administrator
  • Active Users
  • *****
  • Posts: 5961
    • View Profile
Don't know exactly how much slower it would be, is why I put the "(say)" in there as at the most basic level, it does twice as many calculations for each pixel that has some results from the volumetrics in it, and this is just for the straightforward original ray continuing through the volume. That gets more complex as soon as there is scattering, as you are then creating more and more rays, so it is probably more than 8 times the calculations. You'd be doing one jump of xcm, then from there scattering y rays, where each ray then does another jump of xcm, and then there you scatter another y rays for each and every new point, and so on - so it grows in complexity fast for sure :)
Tom Grimes | chaos-corona.com
Product Manager | contact us

2025-02-03, 16:52:43
Reply #7

pokoy

  • Active Users
  • **
  • Posts: 1967
    • View Profile
From my tests, step size has the biggest effect on speed. Interpolation has some effect too, but it's not as noticeable.
Another way to save time is using less bounces but that may affect the look of the volumes too much.

If you're rendering volumes in a separate pass and compose them in post, have a look at Arnold, it's built in and can be a lot faster with volumes. Too many GI samples will make it slow, too, but you have more control over the final look and maybe can compensate low GI through some shader wizardry.

2025-02-03, 18:07:08
Reply #8

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 13376
  • Marcin
    • View Profile
If you have some direct light shining into your volume (including the sun), you can increase the Light Samples Multiplier value (let's say to 4, don't use crazy values). This will improve the appearance of light/shadows inside the volume. It all depends on the specific case though.
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2025-02-03, 18:16:36
Reply #9

lollolo

  • Active Users
  • **
  • Posts: 256
    • View Profile
Thanks for explanations.

Did a quick test. 10m cube with volume material and a spotlight above. Tested step sizes between 0.1m and 10m.
Is behaves like you described it, thanks.

But there is no option “only in render pass” for volumetric like the option for caustics, right?


2025-02-03, 21:59:30
Reply #10

pokoy

  • Active Users
  • **
  • Posts: 1967
    • View Profile
Unfortunately, no. And make sure it doesn't mess with alpha and masks, too. It's not supposed to but it might.

2025-02-04, 14:18:39
Reply #11

Jpjapers

  • Active Users
  • **
  • Posts: 1711
    • View Profile
So if i understand it, we can think of step size sort of like the voxel resolution of the volume.
Are the volumes 'adaptive' in any way?

For instance if i use a vdb of some haze and fog for a large scene is the entire thing sampled even if it becomes entirely opaque after a certain distance?

2025-02-04, 15:46:31
Reply #12

dzintas

  • Active Users
  • **
  • Posts: 53
    • View Profile
But there is no option “only in render pass” for volumetric like the option for caustics, right?

You can in roundabout and cumbersome way. You need to exclude your volume from all scene lighting. Then for example, if you have just one sun in the scene. Duplicate it, set it to include mode and only add volume. Add that sun to separate light mix layer, and you can turn volume effect on or off. Plus you'll have separate render element for it. But as I mentioned it becomes cumbersome to setup in scenes with a lot lights.

2025-02-04, 15:54:16
Reply #13

Jpjapers

  • Active Users
  • **
  • Posts: 1711
    • View Profile


You can in roundabout and cumbersome way. You need to exclude your volume from all scene lighting. Then for example, if you have just one sun in the scene. Duplicate it, set it to include mode and only add volume. Add that sun to separate light mix layer, and you can turn volume effect on or off. Plus you'll have separate render element for it. But as I mentioned it becomes cumbersome to setup in scenes with a lot lights.

This is rather clever!