• Advertisement
Sign in to follow this  

glCopyPixels is VERY slow

This topic is 4688 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
Normally you'd redraw the entire scene each frame and use hardware double buffering.

There are some effects that glCopyPixels() may be useful for, and I've also found it extremely slow.

It appears that glCopyTexImage2D is much faster than glCopyPixels**, so you might consider copying it into a texture and then drawing that as a textured quad.

Mark

** on my graphics card, my driver and with the framebuffer settings that I'm using

Share this post


Link to post
Share on other sites
Thanx a lot. I'll try this.
I have tested on geforce2 gts and geforce2 mx (both with 32mb vram) and found it was very slow on both of them.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement