PBO examples ?

The new NVidia WHQL drivers (71.84) offer support for the new Pixel Buffer Object OpenGL extension.

Is there any usage example around ?

(Not the most useful example)

As a test, I have implemented a custom “occlusion query” using asynchronous ReadPixels:

// Bind a STATIC_READ PIXEL_PACK buffer object.
glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, ID);

// Map the buffer object.
buffer = glMapBufferARB(GL_PIXEL_PACK_BUFFER_ARB, GL_READ_ONLY_ARB, getOcclusionSize() << 2, buffer);
// Read the visibility of the previous frame.
visibility = readVisibility(buffer, getOcclusionSize());
// Unmap the buffer object.
glUnmapBufferARB(GL_PIXEL_PACK_BUFFER_ARB);

// Initialize an asynchronous ReadPixels, we'll read this at the next frame.
glReadPixels(x, y, width, height, GL_DEPTH_COMPONENT, GL_FLOAT, 0);

// Unbind the buffer object.
glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, 0);

Mmmhh complex OpenGL stuff ahead!

Ok Spasi, I’ll check it asap.

All my best to Greece!