Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

glReadPixels( ) is slow!!!

126 views
Skip to first unread message

Jonathan Dinerstein

unread,
Dec 5, 2001, 12:43:20 PM12/5/01
to
I need to read color pixel information back from a pbuffer, but I've
found glReadPixels( ) to be horribly slow.

Because of this, I've considered using directx to lock the surface and
read the pixels directly (I'd assume this would be faster). Is this
possible? IE, can I lock a pbuffer using the information available?
I know directdraw has a method IDirectDraw3::GetSurfaceFromDC( ), but
I'm not sure that this will work as the pbuffer DC seems to be
"unusual" to me.

Will using directx be any faster than glReadPixels( )? I'm using an
ATI Radeon 8500 video card.

Thanks! =)

Jonathan Dinerstein
jondin...@yahoo.com

Ian Hawley (aka The Ox)

unread,
Dec 6, 2001, 5:20:39 AM12/6/01
to
Reading pixels or any other data back from the card is slow, pretty much
period. These days card manufactureres are concentrating on making cards
draw triangles faster and faster and if the pipleine can be made programable
in the process and handle T&L as well, then all the better!

Getting pixel data back from the card is one of those operations where
across hardware and drivers there is likely to be quite a disparity in
performance. If you want it to be consistent, then I would examine the
reasons why you need to get pixel data back from the card and see if it is
really necessary!?

I would not use the IDirectDraw3 interface as this is likely only to create
a surface based on the DC's state information; it is unlikely to populate
that surface with the same bits and even if it did yoi've just added a
potentially expensive blit to the operation. Having done all that you
suffer the same problem with locking the surface, the only advantage here is
that with later versions of DX you can elect to retreive small portions of
your surface, which may improve performance.

Why do you need to do this? Tell us all the context and perhaps someone can
help.

Ox

"Jonathan Dinerstein" <jondin...@yahoo.com> wrote in message
news:bf0fe52f.01120...@posting.google.com...


---
This email has been checked for viruses
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.265 / Virus Database: 137 - Release Date: 18/07/2001


Stefan Krause

unread,
Dec 6, 2001, 9:59:41 AM12/6/01
to
What Pixelformat are you using? The speed for ReadPixels differs quite
strongly depending on your implementation (Try to measure which of GL_RGB,
GL_RGBA, GL_BGR_EXT and GL_BGRA_EXT and type GL_UNSIGNED_BYTE works fastest
for you)

Nevertheless I don't think reading the whole framebuffer each frame can
yield good performace. Maybe you can tell us what you want to achieve -
could be that there's another solution...

"Jonathan Dinerstein" <jondin...@yahoo.com> wrote in message
news:bf0fe52f.01120...@posting.google.com...

0 new messages