Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualmhagain

Posted 07 November 2012 - 07:13 AM

You can't do this directly as you would be both reading from and writing to the same GPU-side resource at the same time, so you have two main options.

Option 1 is to use a framebuffer object, which is basically what you've just described. Yes, it has some additional overhead, but it's not too onerous. This is the tried and tested solution used by all modern games, whether they be using GL FBOs or the D3D equivalent, so you can safely and confidently use it.

There's no real additional copying involved with this, but you are effectively covering each pixel in a screen-sized rect twice. Expect to lose at most 25% of your performance if you're already GPU-bound; if you're CPU-bound you may not even notice it.

Option 2 is to draw as normal, then glCopyTexSubImage to a screen-sized texture. This one does involve extra copying and extra data traffic, so it's going to be slower than using an FBO, but it is handy to keep as a fallback for GL implementations that don't support FBOs.

#1mhagain

Posted 06 November 2012 - 12:35 PM

You can't do this directly as you would be both reading from and writing to the same GPU-side resource at the same time, so you have two main options.

Option 1 is to use a framebuffer object, which is basically what you've just described. Yes, it has some additional overhead, but it's not too onerous. This is the tried and tested solution used by all modern games, whether they be using GL FBOs or the D3D equivalent, so you can safely and confidently use it.

There's no real additional copying involved with this, but you are effectively covering each pixel in a screen-sized rect twice. Expect to lose at most 25% of your performance if you've already GPU-bound; if you're CPU-bound you may not even notice it.

Option 2 is to draw as normal, then glCopyTexSubImage to a screen-sized texture. This one does involve extra copying and extra data traffic, so it's going to be slower than using an FBO, but it is handy to keep as a fallback for GL implementations that don't support FBOs.

PARTNERS