Jump to content
  • Advertisement
Sign in to follow this  
hallgeir

Rendering to texture - without clearing scene

This topic is 3331 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'm trying to render a small amount of quads to a texture, without rendering the whole scene to the same texture. BUT - only way I've found to achieve this, is to follow this procedure: 1. Copy the current content of the drawing buffer either to a texture, or using accumulation buffer 2. Clear the scene 3. Render the quad(s) to the buffer 4. Copy the content of the buffer to a texture 5. Re-render the original scene using the copy from #1 but needless to say, this involves a lot of (seemingly) un-neccesary and costful operations (mainly step #1, #2 and #5. There HAS to be some better way to achieve this? I have been looking into using framebuffer objects, and although it seems quite like something I could use, my current graphics card are pretty little exciting (and is missing the framebuffer_object extension). Any hints? :) Thanks in advance! Best regards, Hallgeir

Share this post


Link to post
Share on other sites
Advertisement
If your card doesn't have the GL_EXT_framebuffer_object extension, you can't do things the easy way, but you may be able to do them the hard way. Do you have the WGL_ARB_pbuffer extension? (Note: You'll need to get that using the wglGetExtensionsStringARB func.)

Share this post


Link to post
Share on other sites
I'm guessing the WGL_* stuff are windows specific? Because I have no WGL_ extensions (I use Linux (more accurately, Ubuntu 9.04)). I do however have support for a bunch of GLX_ extensions, among those, the GLX_SGIX_pbuffer extension. Can I assume that it is the same as the WGL_EXT_pbuffer extension?

Share this post


Link to post
Share on other sites
Quote:
Original post by hallgeir
I do however have support for a bunch of GLX_ extensions, among those, the GLX_SGIX_pbuffer extension. Can I assume that it is the same as the WGL_EXT_pbuffer extension?
It's the same inasmuch as it does the same sort of thing and is similarly painful compared to FBOs, yes. [grin] That's what you'll want to play with. It's basically a way to create a wholly separate GLX context, one which draws into something that can become a texture directly, with no copying.

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!