7
$\begingroup$

I've noticed that glass objects tend to turn really dark when adding volume scattering.

It seems the volume scatter shader gives a much different result when a refraction shader is used in the surface, even if the aforementioned refraction shader is theoretically doing nothing.

Here's a test, rendered with 1000 samples:

  • On the left is a refraction shader with the color and IOR set to 1, essentially just an un-optimized transparent shader.
    Naturally, it looks like nothing is there (though some extra noise can be observed if you look closely at the ground where it should be)
  • On the right is a volume shader setup with a true transparent shader. Looks fine.
  • In the middle, the volume setup from the right is used with the "transparent-refraction" from the right.

enter image description here

As you can see, the middle looks much different from the right, despite the refraction shader making no change to anything in the left.

Exact setup for the middle Suzanne:

enter image description here

What's going on here?

$\endgroup$
  • $\begingroup$ I'm not sure, but I'm guessing it's up to the amount of bounces, even though the Refraction Shader looks like doing nothing, yet when a Camera Ray hits the surface it will change into a Transmission Ray, then exiting the surface on the other side will count as another bounce. So if not enough bounces are allowed, it's just like when a glass shader looks black when no enough bounces are allowed, so that multiplied with the Volume Scatter added to Volume absorption..hmmm, well as I said, it could be the reason. $\endgroup$ – Georges May 2 '16 at 3:33
  • $\begingroup$ This seems like a solid theory. Why don't test it quickly, and post it as an answere? $\endgroup$ – Róbert László Páli May 2 '16 at 8:14
  • $\begingroup$ A quick test of mine suggests that increasing the number of volume bounces helps. However AFAIK the refraction node shouldn't count towards the number of volume bounces, so why does it have have an effect? $\endgroup$ – gandalf3 May 2 '16 at 8:30
  • $\begingroup$ I'm kind of new to Blender and Cycles, but I know the Ray changes it's registration type and count everytime it hits a new surface, I really don't know how volumetrics are calculated "yet" but I'm sure they are using the same rays fired from the Camera, so any additional change in a ray's registration type or count is using the bounces made available by render parameters. $\endgroup$ – Georges May 2 '16 at 9:59
7
$\begingroup$

Solution

Set Properties panel / Scene / Bounces / Volume value to at least one.

Explanation

Probably your volume bounces is set to zero because it is the default setting. That means only direct lighting on volumes are allowed, however caustics¹ are not. The same goes for the diffuse bounces value: If you set it to zero, caustics will not be present² and the perfectly transparent refractive object will cast shadow.

¹ Caustics is actually simply indirect lighting, but is handled specially due to its noisy nature.

² No recursive indirect sampling (also known as bounce, hence zero bounce) allowed.

Alternative Solution

You could also disable shadow casting on the refractive object and leave the volume bounces zero. The result will have less noise, but will lack proper caustical shadows. Or you could set up fake caustics like this one: https://urchn.org/post/fake-caustics-in-cycles

$\endgroup$
  • $\begingroup$ It seems I misunderstand how the bounce settings work. I thought they limited the number of bounces per-ray-type (so a refraction bounce counts as 1 towards hitting the max transmission bounce setting, and doesn't have any affect on other ray types). However, if I understand correctly, it seems they limit the number of bounces based on the total number of bounces ray has taken (so a refraction bounce counts as one bounce, and if that's >= the max for the ray's current type (e.g. volume), the ray is terminated). Is this correct? $\endgroup$ – gandalf3 May 2 '16 at 20:04
  • $\begingroup$ I think it goes this way: $\endgroup$ – Róbert László Páli May 2 '16 at 20:13
  • $\begingroup$ 1: Check currently calculated surface type (diffuse for example). 2: See how many surfaces of that type (diffuse) where already hit by the ray. 3a: If this number is greater than or equal to the limit of the bounces of that type (the diffuse bounces setting), do not cast any recursive ray¹, only direct lighting. 3b: If the limit is not reached, calculate direct lighting and recursively cast a ray (in some semi-random direction from the hit point). ¹It could not be predicted what type of surface will be hit next. $\endgroup$ – Róbert László Páli May 2 '16 at 20:23
  • $\begingroup$ Or in other words: "If this caustics would be calculated, then the previous diffuse surface would have bounced the ray to the glass, however only 0 diffuse bounces are allowed." $\endgroup$ – Róbert László Páli May 2 '16 at 20:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.