Volumes rendered in front of objects in Eevee

I’ve had this problem in a couple of projects now, where a volume that should be rendered behind another object is visible:

And the view from the camera:

Any ideas?

Here’s the blend file:
Volume_Z_Issue.blend (1.5 MB)

Volumetrics clipping values are not coherent with scene.
So, you have 64 volume samples to represent a space that goes from 0.1 meter to 100 meter.
That means that 1 sample has a width of 1.5625 meter (100/64).
So, yes. If you set camera at 0.5 meter of volume, first sample is rendered whatever is between camera and volume.

You have to set an amount of samples close to 250 (don’t do that) to have this clipping rendered correctly.
Instead of increasing amount of samples, you should rather decrease End of Volumetrics Clipping to a value pertinent for your scene : 3 or 4 meters.

1 Like

Interesting, I guess I’d never really understood the difference between the tile size and the samples. Well, at least tile size seemed to make everything more detailed, and samples just seemed to increase render times, hah!

But it seems like tile size is the x/y (in terms of screenspace) size, and samples is how many slices the depth is divided into, yes?