Jump to content
  • Advertisement
Sign in to follow this  
chrimeea

glCopyPixels is VERY slow

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

Hello, I am having this very strange problem with glCopyPixels. I have a prerendered background image that I display on the screen and I also have the z-buffer filled with the corresponding values. At some point I want to scroll the image in one direction. For this I use glCopyPixels to move the pixels from the color buffer a little so that I create a scroll effect. In the same time, I want to keep the z-buffer synchronized with the image so I have to also scroll the z-buffer. I use glCopyPixels with GL_DEPTH but it works extremely slow, something like 3 seconds per function call. By contrast, when I use GL_COLOR instead of GL_DEPTH, it takes only a few miliseconds to complete. I've disabled all fragment operations like fog, blending, lighting, texturing, anything I can think of. If I use a combination of glReadPixels and glDrawPixels it works faster than glCopyPixels on z-buffer ! Anybody had the same problem ? Or maybe some alternatives ?

Share this post


Link to post
Share on other sites
Advertisement
I don't know if it helps, but if I want to draw a fixed image to the screen, I enable an Ortho View, draw a quad across the whole screen (or a specific region) and apply a mipmapped texture (with the same width/height as the quad) onto it.

Works pretty well

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!