I've been looking at the screen capture example and it has the following 
options:


Code:

    while (arguments.read("--no-pbo")) mode = 
WindowCaptureCallback::READ_PIXELS;
    while (arguments.read("--single-pbo")) mode = 
WindowCaptureCallback::SINGLE_PBO;
    while (arguments.read("--double-pbo")) mode = 
WindowCaptureCallback::DOUBLE_PBO;
    while (arguments.read("--triple-pbo")) mode = 
WindowCaptureCallback::TRIPLE_PBO;




I can see the point of using a PBO, I see the difference in performance, what I 
can't figure out is why use double or triple PBOs in this example.

I've read about using multiple PBOs here:
http://www.songho.ca/opengl/gl_pbo.html and where there is a copy out/copy back 
thing going on, multiple PBOs make sense.

What I can't make sense of is why are there multiple PBOs in this sample.  
There is only ever one image object created, and we copy into it and then 
optionally write it to disk, but all that seems to be happening in the render 
thread, so why the double and triple pbo options?

And on top of all of this, is the fact that the single PBO is actually twice as 
fast on memcpy as the double and triple pbos.

Still, the  speed of glReadPixels is bothersome in that it is nearly 9-14 times 
slower than memcpy!  I'm seeing that other people are getting speeds > 
1Gpixel/sec and my speed is a ~5th of this.

I'm running an NVidia GeForce 9600 GT cards in a nice multicore box.

My data is below


With Single Buffer: (Fastest)

> Last camera 01197848
> Select GL_BGR read back format
> Window size 1024, 800
> Reading window usig glReadPixels, with a single PixelBufferObject.
> Allocating image
> Generating pbo 1
> fps = 60.505, full frame copy = 4.3701ms rate = 187.46 Mpixel/sec, 536.31 
> Mb/sec time for memcpy = 0.30403ms  memcpy speed = 7708.8 Mb/sec
> fps = 59.936, full frame copy = 4.0535ms rate = 202.1  Mpixel/sec,  578.21 
> Mb/sec time for memcpy = 0.28201ms  memcpy speed = 8310.8 Mb/sec
> fps = 59.976, full frame copy = 4.0238ms rate = 203.59 Mpixel/sec, 582.48 
> Mb/sec time for memcpy = 0.28248ms  memcpy speed = 8297.1 Mb/sec
> fps = 59.957, full frame copy = 3.9798ms rate = 205.84 Mpixel/sec, 588.91 
> Mb/sec time for memcpy = 0.28153ms  memcpy speed = 8325.1 Mb/sec
> fps = 59.916, full frame copy = 3.9875ms rate = 205.44 Mpixel/sec, 587.77 
> Mb/sec time for memcpy = 0.28051ms  memcpy speed = 8355.3 Mb/sec
> fps = 59.992, full frame copy = 3.9747ms rate = 206.11 Mpixel/sec, 589.67 
> Mb/sec time for memcpy = 0.28021ms  memcpy speed = 8364.3 Mb/sec



With Double Buffer:

> Last camera 00DC7848
> Select GL_BGR read back format
> Window size 1024, 800
> Reading window usig glReadPixels, with a double buffer PixelBufferObject.
> Allocating image
> Generating pbo 0
> Generating pbo 2
> fps = 60.461, full frame copy = 4.5647ms rate = 179.46 Mpixel/sec, 513.45 
> Mb/sec time for memcpy = 0.50115ms  memcpy speed = 4676.7 Mb/sec
> fps = 59.965, full frame copy = 4.2658ms rate = 192.04 Mpixel/sec, 549.43 
> Mb/sec time for memcpy = 0.48359ms  memcpy speed = 4846.6 Mb/sec
> fps = 59.955, full frame copy = 4.2108ms rate = 194.55 Mpixel/sec, 556.6 
> Mb/sec  time for memcpy = 0.46922ms  memcpy speed = 4995 Mb/sec
> fps = 59.944, full frame copy = 4.1795ms rate = 196.01 Mpixel/sec, 560.78 
> Mb/sec time for memcpy = 0.46529ms  memcpy speed = 5037.1 Mb/sec
> fps = 59.945, full frame copy = 4.2554ms rate = 192.51 Mpixel/sec, 550.77 
> Mb/sec time for memcpy = 0.47243ms  memcpy speed = 4961 Mb/sec
> fps = 59.95,  full frame copy = 5.0273ms rate = 162.95 Mpixel/sec, 466.21 
> Mb/sec time for memcpy = 0.47328ms  memcpy speed = 4952.1 Mb/sec


With Triple Buffer:

> Last camera 02957848
> Select GL_BGR read back format
> Window size 1024, 800
> Reading window usig glReadPixels, with a triple buffer PixelBufferObject.
> Allocating image
> Generating pbo 0
> Generating pbo 2
> Generating pbo 3
> fps = 59.868, full frame copy = 4.5804ms rate = 178.85 Mpixel/sec, 511.69 
> Mb/sec time for memcpy = 0.52078ms  memcpy speed = 4500.5 Mb/sec
> fps = 59.963, full frame copy = 4.2532ms rate = 192.61 Mpixel/sec, 551.06 
> Mb/sec time for memcpy = 0.53241ms  memcpy speed = 4402.1 Mb/sec
> fps = 59.951, full frame copy = 4.2342ms rate = 193.47 Mpixel/sec, 553.53 
> Mb/sec time for memcpy = 0.53647ms  memcpy speed = 4368.8 Mb/sec
> fps = 59.367, full frame copy = 4.2459ms rate = 192.94 Mpixel/sec, 552.01 
> Mb/sec time for memcpy = 0.51571ms  memcpy speed = 4544.7 Mb/sec
> fps = 59.955, full frame copy = 4.2701ms rate = 191.84 Mpixel/sec, 548.87 
> Mb/sec time for memcpy = 0.50203ms  memcpy speed = 4668.5 Mb/sec
> fps = 59.957, full frame copy = 4.3925ms rate = 186.5 Mpixel/sec,  533.59 
> Mb/sec time for memcpy = 0.50511ms  memcpy speed = 4640.1 Mb/sec
> fps = 59.36,   full frame copy = 4.6236ms rate = 177.18 Mpixel/sec, 506.91 
> Mb/sec time for memcpy = 0.50729ms  memcpy speed = 4620.2 Mb/sec
> fps = 59.959, full frame copy = 4.3428ms rate = 188.64 Mpixel/sec, 539.69 
> Mb/sec time for memcpy = 0.5006ms  memcpy speed = 4681.8 Mb/sec


------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=22471#22471





_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to