[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mesa3d-users
Subject:    Re: [Mesa3d-users] Fastest way to grab pixel values in to memory
From:       Brian Paul <brianp () vmware ! com>
Date:       2009-07-31 14:48:33
Message-ID: 4A730441.20102 () vmware ! com
[Download RAW message or body]

Srimal Jayawardena wrote:
> Hi all
> 
> 
> I'm working on a Image recognition project where I need to do
> calculations on different views (more than 100 frames)
> of a 3d model within an order of less than 1 sec, in order to
> calculate a particular optimization function.
> 
> I am hoping to use OpenGL to obtain 2D pixel values from different 3D
> view points, in the hope that the 3d h/w processing will do things a
> lot faster for me.
> 
> I need to render 100frames of 20,000 triangles
> in less than 1sec.
> 
> At the moment I am using glReadPixels() to read transformed pixel
> values into memory.
> 
> This is a bit slow and it takes around 10sec to grab 100 frames .
> 
> Is  there a faster way? Or would you recommend a
> better approach?
> 
> I've heard of buffer object ? but am not quite sure how they can
> be used to grab pixel data into memory.
> 
> Rendering the pixels into some virtual buffer is fine with my application
> as long as reading the pixel values happens in less than 1 sec.
> 
> 
> Any pointers would be much appreciated.
> 
> Thanks in advance

Which hardware/driver are you using?

The only thing I can suggest is trying different format/type 
parameters to glReadPixels().  A combo such as 
GL_BGRA/GL_UNSIGNED_INT_8_8_8_8 might be a better match for the 
hardware layout and allow the driver to avoid swizzling.  But this can 
vary from one gpu/driver to another.

-Brian

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Mesa3d-users mailing list
Mesa3d-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic