Hello, thanks for ur answer. And the last part of your answer is my new questione. I performed a multipass shader (glow).
I tried it with glowing a teapot. To avoid redrawing of the teapo after the shader has been performed I render the teapot in 2 textures. So my fbo has 3 textures. (color attachments) attachment 0 and 1 are for the pingpong and 2 has the original teapot. at the end i draw a full screenquad with my original teapot textured on it and then i blend over the glowed teapot. Well that works fine so far. but i if i have geometry drawn before or after the teapot, i cant see it, because i rendered a fullscreenquad.
RendertoTexture(true,targettexture 0 and 2);
drawOriginalteapot(from target texture 2)
So in both case wether the cube is drawn before texture fetch
or after drawing fullscreen quad, i cant see it.
Your hind with the depth buffer makes me think i can save the state of the depthbuffer at the time when i render the reapo into the texture and then when i draw the final result i have to
write the save depth buffer.
Dont know if this works or even if this is the proper way to do.
Im working with Nvidia Cg Shader.
And i can i create a FBO that has a color_attachment and a depth_attachment at the same time ? so that i can call glBindFramebufferEXT and glBindRenderbufferEXT. I think, yes. Am I right ?