I think perhaps I am forgetting some aspect of the OpenGL Fixed Function Pipeline…
Sorry for the length of this post.
Basically I have a HUD overlaid on a complex OpenGL scene. The scene almost entirely relies on shaders for drawing and is totally stable. The HUD does not use shaders at all. So it is affected by the state of OpenGL. Earlier today after apparently no code change a problem occurred. Believe me I have tried rolling back but the problem persists.
Looking in some directions in my scene the HUD text and images are drawn using their correct colours. In other directions the colours (whilst still being similar to their definition) are varying degrees of washed out. Almost like lighting is on, or some blending mode is not as I expect. My first instinct was that it was the blend mode, or GL_TEXTURE_ENV_MODE that was being altered by the scene and the state was affecting my HUD.
So I profiled the code and took comprehensive text dumps of the OpenGL state just before the HUD is drawn in both styles. i.e. Looking once in each direction that gives different results. I then did a diff on the resulting text files to find what attributes were changed.
I found that a couple of colour pointers had changed, but I don’t use arrays in the HUD and just to make sure forced all the pointers and client states to NULL/off.
I found that lighting was not on, but in any case forced it off.
I also noticed that there was a difference in the GL_TEXTURE_ENV_MODE for one texture, which I thought for sure was the culprit. I fixed that.
I now have 20 or so lines of OpenGL code before the HUD is drawn simply to squash any and all pointer, texture mode, blend mode, array pointers etc. being in any state that might cause problems.
Off the top of anyones head, bearing in mind that my GL profiler shows no further differences other than some matrix differences, and no shaders or buffer objects are enabled what could be causing this effect?