[GEM-dev] framebuffer and pix_data

Wesley Smith wesley.hoke at gmail.com
Sun Jun 1 22:16:42 CEST 2008


>> What exactly do you mean by 16/32 bits color?  Do you mean per-channel
>> or combined RGBA values?
>
> i mean per channel.
>
>
>>  glReadPixels works with any format that I've
>> come across.  What makes you think it won't work for your situation?
>
> the doc i find there :
> http://www.opengl.org/sdk/docs/man/xhtml/glReadPixels.xml
> does not specify a format with 16/32 bit per channel.
> unless i'm misunderstand something...
>
> did your really used glReadPixels with 16 or 32 bit per channel?
> and if yes, with what type and format?

The OpenGL docs like this one don't cross-reference other uses/abuses
of the function.  glReadPixels as documented in your link refers to
its use on the standard OpenGL drawing buffers but does not mention
anything about extensions like FBOs.  Typical OpenGL draw buffers can
only have integer types, so you don't see the higher bpp type enums in
the docs.  However, when an FBO is active, you can set the read buffer
to the FBO as in glReadBuffer(GL_COLOR_ATTACHMENT0_EXT).  Then when
you call glReadPixels, it will read the pixels in the FBO and if the
FBO happens to have a float texture target attached to it, you will be
able to read floating point values via glReadPixels.

HTH,
wes




More information about the GEM-dev mailing list