Jump to content
  • Advertisement
Sign in to follow this  

reading floats from pixel buffer objects

This topic is 4396 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I want to read out float values from a pixel buffer object, but unfortunately it doesn't work. First i initialize the pbo like this:
 
glGenBuffers(1, &pixelBuffer_);
glBindBuffer(GL_PIXEL_PACK_BUFFER_EXT, pixelBuffer_);
glBufferData(GL_PIXEL_PACK_BUFFER_EXT, number*4*sizeof(float), NULL, GL_DYNAMIC_COPY_ARB);
glBindBuffer(GL_PIXEL_PACK_BUFFER_EXT, 0);

And after rendering i want to read it out:
 
glBindBuffer(GL_PIXEL_PACK_BUFFER_ARB, pixelBuffer_);
glReadPixels(0,0,res,res,GL_RGBA,GL_FLOAT, NULL);
void* pboMemory = glMapBuffer(GL_PIXEL_PACK_BUFFER_ARB, GL_READ_ONLY_ARB);

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!

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!