Anton Duzenko
Anton Duzenko

Reputation: 2616

OpenGL strange color

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?

Upvotes: -1

Views: 52

Answers (1)

Anton Duzenko
Anton Duzenko

Reputation: 2616

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

Upvotes: 1

Related Questions