Render to texture while reading from existing framebuffer

Started by
1 comment, last by JohnOwens 10 years, 11 months ago

Is this possible?

What I'm looking to do is render a load of particles into a texture however still using the framebuffer's zbuffer which hasn't been cleared and then composite that with the main color framebuffer (which already has the scene rendered into it).

I've tried just not attaching the depth component to the FBO but that didn't work.

Or do I need to render the scene to a rtt, copy it's depth texture into the particles rtt depth texture and then render into the particles rtt?

Thanks

Advertisement

Your depth buffer need to be attached as part of your FBO. Once you bind an FBO it is like your default depth buffer doesn't exist and all render takes place only on the FBO until it is unbind.

Thanks I was beginning to suspect that :-)

This topic is closed to new replies.

Advertisement