Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#ActualBrother Bob

Posted 15 July 2012 - 11:38 AM

There are some ambiguities in your post that should be cleared up. First, a GL_SHORT type can hold negative values. It is not restricted to positive values. However, when converting an integer color value to a color of type GLclamp (the normal [0, 1] range for low dynamic range color), it maps integer 0 to 0.0,  and the maximum possible integer value to 1.0. So a GL_SHORT can only represent low dynamic range coor values in the range [0, 32k]. It can store negative values, but they are all mapped to color value 0.

So don't confuse clamped color values and GL_SHORT and its ability to store negative values.

The key here is to store color values in a format that is not clamped. I am not sure at the moment, but I think it is enought o change the internal format to either an integer format or a floating point format. For example, the internal format GL_RGBA32F should make a non-clamped RGBA floating point texture, or GL_RGBA16I for a 16-bit signed integer texture.

#1Brother Bob

Posted 15 July 2012 - 11:37 AM

There are some ambiguities in your post that should be cleared up. First, a GL_SHORT type can hold negative values. It is not restricted to positive values. However, when converting an integer color value to a color of type GLclamp (the normal [0, 1] range for low dynamic range color), it maps integer 0 to 0.0,  and the maximum possible integer value to 1.0. So a GL_SHORT can only represent low dynamic range coor values in the range [0, 32k]. It can store negative values, but they are all mapped to color value 0.

So don't confuse clamped color values and GL_SHORT and its ability to store negative values.

The key here is to store color values in a format that is not clamped. I am not sure at the moment, but I think it is enought o change the internal format to either an integer format or a floating point format. For example, the internal format GL_RGBA32F should make a non-clamped RGBA floating point texture.

PARTNERS