Jump to content
  • Advertisement
Sign in to follow this  
Njguy

OpenGL Drawing to texture

This topic is 1487 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

In opengl-es 2.0 can a fbo rendering to a texture, use a texture target that is larger than the screen? If so, is it possible to draw a textured quad, filling up the fbo-texture corner to corner? If not possible is it possible to do this in another way in opengl-es? I have some layered procedurally  generated graphics at load time that I would like to combine into single textures in order to save on performance at draw time.

Share this post


Link to post
Share on other sites
Advertisement

Thats the whole premise of GL FBO. The FBO is independent of the windowing system with pixel ownership belonging to GL, this means the FBO attachment size is limit by the GL implementation maximum texture/render buffer sizes..and NOT..the size of the window.

Share this post


Link to post
Share on other sites

Thats the whole premise of GL FBO. The FBO is independent of the windowing system with pixel ownership belonging to GL, this means the FBO attachment size is limit by the GL implementation maximum texture/render buffer sizes..and NOT..the size of the window.

Well that is good, but how are you supposed to draw a quad to fill up the fbo-texture 100% corner to corner? Or does it do this automatically? 

Share this post


Link to post
Share on other sites
Take a texture of any size, set it as an FBO attachment (you can render to any attachment on an FBO—OpenGL ES 2.0 just limits how many attachments you can have, which limits the number of render targets you can have simultaneously) and activate.

The viewport is automatically set to the dimensions of the render-target when you activate it, but for good measure you may as well manually set the viewport also (especially for testing just to eliminate 1 more bug factor).

It’s the viewport that determines the rendering area, not the screen size. So to render to a 1,024×1,024 texture, set the viewport accordingly.


L. Spiro

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!