I want to make a volumetric shader

Hey guys and gals,

I want to create a volumetric shader. I believe that what I’ll need is the volumetric object’s back faces z-depth, the front faces z-depth then the z-depth of everything else in the camera view.

Can anyone point me in the right direction as to how I can get these values? I’m rather noobish as far as shaders go, but I’m keen to learn by doings something rather outrageous :wink:

Thanks for any help guys and gals :slight_smile:

from Pos.z in vertex shader

from _CameraDepthTexture

to get object’s back face z-depth, you need to render that object into separate depth texture with front face culling