Fire & smoke sim materials

First post :slight_smile:
I have a nice fire/smoke sim set up and the materials are working and rendering fine. Actually looks pretty good. But I’ve been wondering something :
In the viewport the smoke can appear ‘in front of’ the fire. This gives a much more 3D (volumetric) look to the whole thing as the smoke billows out and occludes the fire.
But I cannot figure out how to set up my materials to get the same effect in the renderer. It seems like you would need to the ability to base the volumetric textures on z depth instead of just the ‘density’ it seems to be based on now. Am I missing something glaringly obvious - it seems weird that the realtime 3D viewport can do this and not the BI renderer?