Your thoughts on and comments to Volume Rendering in Unreal Engine 4.

I believe that you could use the custom depth of the backfacing geometry to solve that. So you render the front faces using the translucent material, then you duplicate the mesh and render an inverted face masked material that renders custom depth. Then in the volumetric material you would derive the start depth by using PixelDepth and then you use the exit depth using custom depth. Then you handle going inside you could have yet another effect that does the inverse where starting depth is 0 aka camera position. It may be tricky to make sure that the outer mesh always sorts over the inner one and might require some messing with separate translucency or something (or maybe that is tough to solve).

The obvious downside to that is it won’t handle a ray that entered and exited a volume multiple times so your ‘mesh’ would have to encapsulate the entirety of each effect, you couldn’t cut out the little puffs of smoke on the edge to be separate meshes for instance since the custom depth of the backside would be opaque.

This should be quite a bit faster and is similiar to how I did the metaballs for the protostar demo. If you end up modulating the density you will have to expand the outer geometry shell unless the modulation is only removing volume.