I was reading a tutorial on creating volumetric lighting for some language/engine that wasn’t applicable to Blender, and they mentioned something named “cdepth”… From context I induced that this was basically a depth render excluding the object in question, namely whatever object the shader was applied to. Is there any way to do something along these lines in Blender’s game engine, with filters or shaders? Thanks.
Do you happen to have links to some of these references? The more information we have, the easier it is for use to help you.
However, from what I understand of your question I think the answer is yes, but not easily. Using PyOpenGL you could set up an additional render pass using the KX_scenes post_draw list for drawing your volumetric lights. These lights can then use the depth buffer already established during the main drawing (that they were not a part of). You may need to do a glCopyPixels to get the depth buffer to a texture in that case.
Ah- here it is: http://www.john-chapman.net/content.php?id=16
Yeesh. I’ll look into it… Thank you!
Looks like the cdepth referred to in that article is the depth of the fragment from the cone. I believe that should gl_FragCoord.z in the cone’s fragment shader (assuming the cone has gone through all the appropriate transforms).