Jump to content
  • Advertisement
Sign in to follow this  
TosKeN

OpenGL FBO and Multiple render targets

This topic is 4207 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!