what i basically want to do is saving and restoring my depth buffer.
My first (very stupid) approach for testing my algorithm was: copying the depth buffer via readpixels to RAM and afterwards write it back to the depthbuffer via Drawpixels.
Now as you all can imagine this is pretty slow with increasing viewport size (pixels).
so i thought: yeah, why copying the stuff to the cpu, lets leave it on the graphics card.
Yeah so i initialized a PBO and did all that with PBO (code follows).
My algorithm still works, but it is as slow as before, so no real performance boost although I am using PBOs.
glBufferData(GL_PIXEL_UNPACK_BUFFER, window_wwindow_hsizeof(float), 0 , GL_DYNAMIC_DRAW);
Read from Depth Buffer:
glReadPixels(0,0,window_w,window_h,GL_DEPTH_COMPONENT, GL_FLOAT, (GLvoid*)0);
Write it back:
glDrawPixels(window_w, window_h, GL_DEPTH_COMPONENT,GL_FLOAT, (GLvoid*)0);
So my question is:
Why is there no performance boost?
Am I forgetting something?
Thanks in advance for all your replies!