0

I need to save the color buffer and depth buffer of a given camera in a scene in Blender Game Engine every frame to a file (each to their own file). Is this possible? How can this be setup using the BGE and python?

Ive asked on the Blender Artists forum but noone seems to have picked up the question.

1 Answer 1

1

Saving the frame buffer out to a file is a very slow operation. So I am going to be assuming you don't have to do this in real time... So what you will want to do is set up two sets of shaders. One that is your normal color shader, and another that renders the depth of the object as the color. Then you will render your scene twice with both sets of shaders. From there you have two options...

  1. Use BGL.glReadPixels to read the screen image every frame and export them manually.
  2. Switchover to the standard blender renderer and render an animation with both sets of shaders.
3
  • How do I render the screen twice in BGE?
    – twerdster
    Jun 8, 2012 at 18:07
  • Dont, either swap the shaders every other frame (render color on even frames, then depth on odd) or render the entire sequence twice. May I ask what you are wanting to use this for? Jun 8, 2012 at 18:16
  • Il use the first method. Definitely the easiest. Using it to simulate depth scanner
    – twerdster
    Jun 8, 2012 at 18:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .