[osg-users] pbuffer performance
robert.osfield at gmail.com
Tue Sep 25 05:28:04 PDT 2007
glCopyPixels will be doing a round trip to the CPU. You might be able
to help out by using a PixelBuffer object for reading and writing, but
as general advice I have to say absolutely don't code the problem in
the way your are doing as it will be slow. Use FBO to render a
texture and then render a quad screen aligned, don't use glCopyPixels
and glDrawPixels at all.
On 9/24/07, Rahul Jain <rahulj at darshan3d.com> wrote:
> Hi Guys,
> This question is not directly related to OSG, but I hope the OSG users
> must have answer to this problem and the reason i am asking this on this
> forum is that because the OSG has most number of OpenGL experts.;)
> I am transfering data from one pbuffer to other pbuffer using
> glCopyPixel and the transfer rate is two slow, 1MB/sec on my Nvidia
> Quadro 4600 (512MB) graphics card.
> Can some one tell me what can be the problem. The detail description of
> what i am doing is given below.
> The two pbuffers i have created using glXCreatePbuffer
> with GLXFBConfig atributes as mentioned below
> int attrib =
> GLX_DOUBLEBUFFER, True,
> GLX_RED_SIZE, 8,
> GLX_GREEN_SIZE, 8,
> GLX_BLUE_SIZE, 8,
> GLX_ALPHA_SIZE, 8,
> GLX_RENDER_TYPE, GLX_RGBA_BIT,
> GLX_DRAWABLE_TYPE, GLX_PBUFFER_BIT,
> The attributes of the pbuufer are
> int pbufAttrib =
> GLX_PBUFFER_WIDTH, 512,
> GLX_PBUFFER_HEIGHT, 512,
> GLX_LARGEST_PBUFFER, True,
> Now i created a context (contx0) and made the context current w.r.t
> Now using glDrawPixel i draw an image in pbuffer0.
> Now using glXMakeContextCurrent(display,pbuufer1(drawable),
> pbuffer0(readable), contx0);
> i set the context so that pixelBuffer1 is my drawable and pixelBuffer0
> is my readable buffer.
> Now i am copying tha data from pixelBuffer0 to PixelBufer1 using
> glCopyPixel() and that is where i am getting the performace hit.
> Since i am transfering data from GPU to GPU the transfer rate should be
> very high (GB/sec)
> but i am getting aroung 1MB/sec.
> Thanks in advance
> osg-users mailing list
> osg-users at lists.openscenegraph.org
More information about the osg-users