When using OpenGL 1.4 fixed-function multitexturing, is the output of every texture stage clamped to [0, 1] before being passed onto the next stages?
The spec says (page 153):
If the value of TEXTURE_ENV_MODE is COMBINE, the form of the texture function depends on the values of COMBINE_RGB and COMBINE_ALPHA, according to table 3.24. The RGB and ALPHA results of the texture function are then multiplied by the values of RGB_SCALE and ALPHA_SCALE, respectively. The results are clamped to [0, 1].
But in my test, that didn't happen. My texture environment for the RGB components is:
- Stage 1: subtract GL_CONSTANT from GL_TEXTURE, where the entire texture is black, and the GL_CONSTANT color is
(.5, .5, .5, 1.0)
- Stage 2: Add GL_TEXTURE to GL_PREVIOUS, where the texture is a test rainbow.
The output gets visibly darker the brighter I make Stage 1's GL_CONSTANT color.
Is there some sort of state I can enable to get the clamping I expect?