OpenGL strange color

54 Views Asked by At

We are upgrading our game from OpenGL 2.1 to 3.1 core (forward compatible) context. It all works very well except one minor but very strange glitch.

We have a white fill texture that somehow becomes red after the 3D world loads. I.e. it starts giving vec3(1,0,0) in fragment shaders when sampling instead of vec3(1,1,1).

It only happens on 3.1 forward compatible contexts. Compatibility 3.1 and even core 3.1 contexts don't exhibit this. There are no GL errors. And, it happens on both Intel and nVidia GPUs.

What could it be?

1

There are 1 best solutions below

0
On BEST ANSWER

I can see that by mistake I was corrupting our white texture by using it to capture depth buffer. As a result, it had internal format of DEPTH_COMPONENT which is LUMINANCE vs RED depending on forward compatibility. enter image description here