Sign in to follow this  
TosKeN

OpenGL FBO and Multiple render targets

Recommended Posts

Hi all, i have a question regarding OpenGL's frame buffer objects and multiple render targets. i set up an fbo and now i wan't to attach two renderable textures to color_attachment0 and color_attachment1 of the fbo. The texture attached to color_attachment0 should be an RGBA Texture with 8 bits per channel and for the second texture i wan't to use a 2 Channel Texture with 16 bits per channel. I'am not so familiar with OpenGL Texture Objects. How can i create a texture with 2 channels and 16 bit per channel? Is it even possible to attach two such different textures to one fbo and render to it? I need it for a Depth of Field effect. In a shader i want to render the color in the first texture and the depth and a blurinnes factor to the 2 chanels of the 16 bit per channel texture. Thank you

Share this post


Link to post
Share on other sites
Sadly you can only attach textures of the same format to your FBO. I reckon the simplest way is to use two RGBA textures and accept there's some memory being wasted. If that's not acceptable (extremely tight memory) then you'll have to us 2 FBO and 2 rendering passes.

Off the top of my head I think there is a 16 bit per channel RGBA texture format (GL_RGBA16_EXT) but I might be wrong. Perhaps use a floating point texture format if there's no 16 bit format because you'll be wanting to do HDR anyway ;-D

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this