Re: advice and/or help on glReadPixels
- From: "drawing in aspnet" <csharpuser@xxxxxxxxxxx>
- Date: 30 Jan 2006 18:28:58 -0800
jbw:
I could not see any "BRGA" in the documentation. I assume you mean
"RGBA" ??
I tried this on my computer and got the same dismal results. Actually
it took slightly longer than RGB but I think that is due to being in a
loop slightly longer to look for red bytes. After all there are width
X height X 4 bytes for this case.
I am in TrueColor mode. Is it possible that some cards are not
optimized for efficient reads? I.e. might my card not take advantage of
the fact that I am requesting 4 bytes and it's TrueColor and do some
sort of byte-moving loops anyhow?
Thanks again,
Dave
jbwest wrote:
> "drawing in aspnet" <csharpuser@xxxxxxxxxxx> wrote in message
> news:1138641677.920635.322190@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> >
> > psvalins@xxxxxxxxx wrote:
> >> a) Try reading the entire RGB instead of just the red. Do your counts
> >> in the cpu.
> >> Also try different formats to check what your hardware likes.
> >>
> >> b)Check if your card supports pixel buffer extension. If yes then you
> >> could try
> >> asynchronous reading. The extension registry has exact details as to
> >> how you
> >> could do this.
> >>
> >> c)If your card supports arb_imaging then you could also try histograms
> >> and sink
> >> them.
> >>
> >> d)Rendering to a texture using render to texture extension could also
> >> be faster than
> >> reading from framebuffers.
> >
> > Thanks for all the advice. I should have mentioned in my first posting
> > that I had tried reading all of RGB before. In fact the result was
> > slightly worse, 12 seconds versus 10.6. Quite possibly, it's exactly
> > the same time and the difference is the time spent looping through all
> > the pixel data and filtering the red ones.
> >
> > Curiously, I ran the program on a friends computer and improved the
> > performance by a factor of 8 (1.3 seconds total). So, I suspect there
> > is great variability on how well different graphics cards do a
> > "ReadPixels". The extensions you mentioned are not available on my
> > card (Intel 915G, GL Version 1.4.0), but quite possibly they are
> > available on another.
> >
> > Thanks again.
> >
> > Dave.
> >
>
> Still very dreadful performance -- did you use BRGA format ? (not RGB, but
> actually BRGA). The Framebuffer is (if in true color mode -- you are in true
> color mode, "16million colors" aren't you?) actually packed that way, so
> that an unsigned byte BGRA read doesn't have to go thru nasty byte-moving
> loops. Ditto on your side, a quick integer loop with a mask & shift is
> probably phenominally faster than byte moves.
>
> jbw
.
- Follow-Ups:
- Re: advice and/or help on glReadPixels
- From: jbwest
- Re: advice and/or help on glReadPixels
- References:
- advice and/or help on glReadPixels
- From: drawing in aspnet
- Re: advice and/or help on glReadPixels
- From: psvalins
- Re: advice and/or help on glReadPixels
- From: drawing in aspnet
- Re: advice and/or help on glReadPixels
- From: jbwest
- advice and/or help on glReadPixels
- Prev by Date: Re: Trimmed NURBS surfaces
- Next by Date: Re: advice and/or help on glReadPixels
- Previous by thread: Re: advice and/or help on glReadPixels
- Next by thread: Re: advice and/or help on glReadPixels
- Index(es):
Relevant Pages
|
|