PDA

View Full Version : BltFast (from DirectX) is faster than glDrawPixels ?



03-28-2002, 01:25 AM
Even when I disable everything that could slow glDrawPixel (zoom, lighting, ... etc), I can't draw large bitmaps(1024*768) as fast as I used to when I used DirectX and the great instruction BltFast, which is very fast.
What is the equivalent of BltFast with OpenGL?

Thank you very much. http://www.opengl.org/discussion_boards/ubb/smile.gif

MButchers
03-28-2002, 01:41 AM
Hello there,

use textured triangle strigps for best results.

to ensure good compatibility with older hardware
limit the size of your textures to 256x256
and draw multiple quads.

Hope it helps

Mark

zeckensack
03-28-2002, 01:58 AM
glDrawPixels is your best bet. It can be very fast. Try also disabling texturing, blending, depth test/writes, stencil test/writes, alpha testing and whatnot. Experiment a bit and profile, then choose the fastest setup.

Another good idea is to know your framebuffer layout, and send the data accordingly. It wouldn't make too much sense to use 32bit color data on a 16bit buffer and vice versa. Neither does it make sense to use RGBA data on a pure RGB buffer. Everything that causes reordering or packing of the data will slow you down.

For starters, the following sequence takes about 7ms with a 640x480x32bit color buffer (including destination alpha)


disable_stuff(); //yeah, you know
glDrawPixels(640,480,GL_RGBA,GL_UNSIGNED_BYTE,duh) ;
reenable_stuff(); //let's move on
YMMV!
Might not seem fast enough, but consider that the overhead of setting up the transfer is the most expensive thing here. The larger the area of the 'blit', the more efficient it will be.