When I watch the pboMemory, it only contains zero values. But if I change GL_FLOAT to GL_UNSIGNED_BYTE in the ReadPixels call, it works. But I need floats. Am I doing something wrong, or doesn’t pbo work with floats?
thanks for answers!
If I try to read floats, the glReadPixels call produces the gl-error “invalid operation”. With unsigned bytes it doesn’t.
I need the pbo, because I compute vertices of shadow volume faces in a fragment shader and in the next render pass I want to use the output of the fragment shader as input for a vertex shader. I already have a working version where I read the fragment shader output into the main memory, but this is slow and with the pbo I want to keep the data in the memory of the graphics card. This should be much faster.
I have working demo… readback to PBO and using this data as VBO… Im using
glReadPixels(0,0,TEXX, TEXY, GL_BGRA, GL_FLOAT, BUFFER_OFFSET(0)) call to readback data from offscreen PBUFFER.
I found my mistake, in the glBufferData call I did not allocate enough memory for floats. Stupid,stupid
Now it works. Thanks a lot for the hint looking for gl errors!!