My question is the same as the one asked here How can I use python in Blender Game Engine (2.5+) to save the depth buffer AND the color buffer to file every frame?. The post gives the function (BGL.glReadPixels) required to obtain the depth buffer. However, I am not able to create a minimal working example (I am very new to blender and 3D programming in general). What I have so far is that I need to perform following steps:
- allocate memory for z-buffer
- Render depth using shader
- call BGL.glReadPixels
I am not able to do these steps in pyhon due to my limited knowledge of blender. Any pointers/help is greatly appreciated.