Write object space coordinates during rendering?

Hi there!

Someone please could tell me if it is possible to render a frame but to write the object space coordinates of the rendered point into a buffer instead of writing color information? Is it possible using some buffer or setting or anything?

p.s.: Sorry my english is not correct

You should be able to do this fairly easily using a fragment program. It will be to the effect of MOV result.color, fragment.position; Only you may have to project the position back into space. (I forget which space fragment.position is in.) Be sure blending is off.

If I might ask, why do you need an image of the positions of things?

Well not the image is important just to get object space coords by some easy way

I’ve made it now reading the depth buffer, it’s almost what i want just i have to calculate the other two coords with gluunproject. (I thought it would be easy to render a small portion of the screen and just read the corresponding “pixel” containing all 3 coords.)
By the way thanks for your reply!

try using float-textures as rendering target.
(if you can live with missing alpha-blending)

Maybe you want to read about the GL_FEEDBACK render mode. I never used it but it sounds like what you are looking for.