Jump to content
  • Advertisement
Sign in to follow this  
Loicus

texture bigger than the windows

This topic is 4428 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... i want to save a shadow map with a maximum of details, so i want to create a big texture... my windows is a 1024*768, but i can't create a square texture bigger than 735*735 if i try to create a bigger one, only a part of the texture get the depth and the rest stay black... have you an idea to solve that problem? thanks you very much

Share this post


Link to post
Share on other sites
Advertisement
I'm having actualy the same problem as you. As far as I know, what we need to do is render offscreen to a pbuffer or a frame buffer object (fbo).

The only problem is... I still don't know how to do that. Ill try to find out soon.

try here: http://www.codesampler.com/oglsrc/oglsrc_14.htm

Good luck.

Share this post


Link to post
Share on other sites
yep you'll have to use framebufer objects.. pbuffers are not a good choice. fbo work similar to texture objects: you create an id, bind a new buffer to it and assign a texture object to that buffer. then you simply enable the buffer to draw into it instead of drawing to the screen.

// generate framebuffer object
glGenFramebuffersEXT( 1, &m_uiBufferId );
glBindFramebufferEXT( GL_FRAMEBUFFER_EXT, m_uiBufferId );

// generate texture object
glGenTextures( 1, &m_uiTextureId );
glBindTexture( GL_TEXTURE_2D, m_uiTextureId );
glTexImage2D( ... );

// assign texture to fbo
glFramebufferTexture2DEXT( ... );

// disable framebuffer
glBindFramebufferEXT( GL_FRAMEBUFFER_EXT, 0 );

note that you will also need to create a renderbuffer to store depth information.

Share this post


Link to post
Share on other sites
You also have to call glViewport() with new "window" dimensions, i.e the dimensions of the pbuffer/fbo, and when you go back rendering to the real window, backbuffer, you call glViewport again with the window size. And possibly update the projection matrix too when doing this.

ch.

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!