Hello everyone,I found the PBuffer readback speed is very difference between ATi and NVIDIA card.I write a short program to test it,the result shows the ATi card has higher performance than NVIDIA.Because I only do my test in a ATi Radeon 9800SE and a NVIDIA GF5200,so I’m not sure whethere the result is correct.So I post my test program’s code(based Glut),and the result I had get,I hope you can do the test on your machine,and also post the result you get,and your opinion about the problem.
#define WIDTH 512
#define HEIGHT 512
#define REPEAT 30
CPBuffer pbuf; // a “PBuffer” object class,you can create a pbuffer by raw OGL command
for (int i = 0; i<REPEAT; i++)
double perf=(double)(end.QuadPart -start.QuadPart)/(double)frequence.QuadPart;
perf = 1.0/perf;
perf = WIDTHHEIGHT*4;
perf /= 1.0e6;
int main(int argc, char* argv)
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH);
glutCreateWindow(“AGP Speed Test”);
Below is my test result:
ATi Radeon 9800SE: 86.507644 copys/sec,90.709838 Mbytes/sec;
NVIDIA GF5200: 3.766799 copys/sec,3.949775 Mbytes/sec(too slow,let me surprise);
My results confirm your bad NV perf :
readpixels from pbuffer :
From normal framebuffer it seems to be ok:
EDIT: GeForce 3 Ti200 , Detonator 45.23
[This message has been edited by ZbuffeR (edited 12-08-2003).]
I have also had problems with the pbuffer.
I hope I am not off topic, but a glClear
in the pbuffer would make the framerate drop
substantially. However, if I replaced the clear with drawing a polygon that covers
the whole pbuffer and setting glDepthFunc to GL_ALWAYS, the framerate was normal.
Thus, given that the functionality of both functions is the same and they yeld such big differences in the framerate, I’ll consider this a driver bug.
I know that this is different than reading from the pbuffer, but it is a “fillrate like” problem too.
Originally posted by fuxiulian:
However, if I replaced the clear with drawing a polygon that covers the whole pbuffer and setting glDepthFunc to GL_ALWAYS, the framerate was normal.
That is true that glClear is slow on pbuffers. However, I tried your ‘fix’, but got no improvement, it is a little bit slower than the glclear.
e.g. in Geforce3 :
glClear(color and depth):37 fps
Which video card did you used ?
I recently had a similar issue on a GeForce 5600. Surprisingly, an easy workarround was to define WIDTH and HEIGHT as 511 (or as another non-power-of-two value).
Disregarding this driver anomaly (?), graphics hardware from NVidia is generally faster than ATI’s for reading back pixel data from the frame buffer or the pbuffer.
Here it works, same as my last test, Geforce3 :
In fact, I had to set NO PARAMETERS for the pbuffer, and particularly avoid those two :
Thanks to MattS for the solution, see this thread : http://www.opengl.org/discussion_boards/ubb/Forum3/HTML/010964.html
(by the way, the 511x511 changed nothing)