Grabbing float pixel values (from frame buffer)?

  • Follow


Is it possible to get the pixel values (frome the frame buffer?) as float
values
(in the range of 0..1) in some way?

I have an application where

  glReadPixels(OrigX, OrigY, width, height, GL_RGB, GL_UNSIGNED_BYTE, data)

is used. If I understand this right this will give me the pixel _integer_
values for R, G and B stored in the buffer 'data'.

To get a more accurate pixel value (for evaluation) I would like to read the
pixel values before they are converted to integer vaules. How can this be
done?



Billy


0
Reply Billy 5/7/2004 9:06:28 AM

Billy wrote:

> Is it possible to get the pixel values (frome the frame buffer?) as float
> values (in the range of 0..1) in some way?
> 
> I have an application where
> 
>   glReadPixels(OrigX, OrigY, width, height, GL_RGB, GL_UNSIGNED_BYTE, data)
> 
> is used. If I understand this right this will give me the pixel _integer_
> values for R, G and B stored in the buffer 'data'.
> 

Try reading the manual: You can type "GL_FLOAT" instead
of "GL_UNSIGNED_BYTE" for the data format.

It won't make the data any more accurate though, if there's
only eight bits of information, there's only eight bits.

> To get a more accurate pixel value (for evaluation) I would like to read the
> pixel values before they are converted to integer vaules. How can this be
> done?
> 

The latest generation graphics cards allow you
to render into pbuffers with floats.


-- 
<\___/>          "To err is human, to moo bovine."
/ O O \
\_____/  FTB.    For email, remove my socks.



0
Reply fungus 5/7/2004 1:48:47 PM


fungus <openglMY@SOCKSartlum.com> wrote:

>It won't make the data any more accurate though, if there's
>only eight bits of information, there's only eight bits.

Is it possible to get acces to the pixel values before the are
represented by eight bits (using OpenGL API's)?


-------------
Thomas
0
Reply Thomas 5/7/2004 11:46:15 PM

Thomas wrote:

> Is it possible to get acces to the pixel values before the are
> represented by eight bits (using OpenGL API's)?

No. But you can use a float pbuffer.

Wolfgang

0
Reply Wolfgang 5/8/2004 4:03:55 PM

3 Replies
329 Views

(page loaded in 0.309 seconds)

Similiar Articles:













7/22/2012 8:39:09 PM


Reply: