fragment program precision loss?
This bit of code uses a pixel shader to do a lookup into a 3d texture based on the color at that pixel fo the 2d texture (i.e. a function based on the color of the 2d texture)
char chromaFragmentProgram="" // this is on purpose.
Assume that the 3d texture is bound with S_WRAP (etc) as GL_REPEAT (i.e. the default).
Now, initialize the 3d texture as an identity function..
// this should be bound on texture unit 1
unsigned char cubeTex;
Now, take a 2d texture that 'saturates' at least one of the color channels, and bind that as the texture on texture unit 0.
When you draw this 2d texture across the screen with the fragment program enabled, you'd expect to see the 2d texture exactly (without change), however, where the 2d texture had a pixel with an channel saturated at 255, you'll see a wrap-around w.r.t. color, and the pixel will appear black instead.
This implies there is a precision loss somewhere in the fragment program! (An annoying one)
Can you confirm this for me, or suggest a workaround?
a sample program is attached.
... it won't compile, since it is missing a 'texture' library, but you should be able to easily adapt it.