Jump to content


NPOT FBO Render Target


2 replies to this topic

#1 laweya

    New Member

  • Members
  • PipPip
  • 29 posts

Posted 04 February 2008 - 01:29 PM

I'm currently working on a render target implementation using a Frame Buffer Object (FBO) , I'm running it on a Radeon X1650 which supports the GL_ARB_texture_rectangle but not the GL_ARB_texture_non_power_of_two extension.

I have attached a texture to the FBO's first color attachment point then at a post processing step the texture is mapped to a full screen quad. My problem is that using non power of 2 dimensions for the render texture results in the rendering being extremely slow.

Could someone please tell me what the conventional way of handling non power of two render targets is?
General game development rumbling
http://law3d.blogspot.com

#2 Vilem Otte

    Valued Member

  • Members
  • PipPipPip
  • 215 posts

Posted 04 February 2008 - 01:34 PM

Its GL_ARB_texture_rectangle extension for example. You don't have to use GL_TEXTURE_2D as texture parameter, but GL_TEXTURE_RECTANGLE_ARB. This is nice way how to handle non power of 2 textures (well it has one disadvantage - coordinates of texture must be in 0 - windowWidth and 0 - windowHeight instead of 0 - 1)

#3 laweya

    New Member

  • Members
  • PipPip
  • 29 posts

Posted 04 February 2008 - 01:41 PM

Thanks for the really quick reply, I'm trying to avoid using GL_TEXTURE_RECTANGLE_ARB because
1 I'm adding OpenGL support to an existing engine who's higher level framework already handles the post processing step and

2. I know it can be done another way, Ogre does it pretty well and I'm currently looking at Ogre's code but haven't come across anything useful.
From what I can see so far, Ogre bumps up the dimensions to the nearest power of two but I can't figure out how the texture coordinates are generated for the new texture's size.
General game development rumbling
http://law3d.blogspot.com





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users