I'm trying to make simple shading for a 2D OpenGL scene by placing semi-transparent black quads over the scene, but in certain places instead of darkening the scene it completely blacks it out. I'm using glBlendFunc(GL_DST_COLOR, GL_SRC_ALPHA)
for the shader quads, and glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
for all the other drawing underneath.
This normally works, dimming the area under the semi-transparent quad, but in certain situations it behaves oddly. When the area under the semi-transparent quad has only had one quad drawn behind it, it behaves normally. When another quad (or multiple quads) are drawn on top of the back quad, it sometimes behaves normally, sometimes blacks out the quad entirely, or sometimes blacks out everything beneath the last-drawn quad (e.g. if I had a red texture with a blue dot on top of it, the red beneath would be blacked out, but the blue dot would remain unchanged).
I thought this looked like the quads drawing in the wrong order, but I have GL_DEPTH_TEST
disabled, so I'm not sure if this is odd behavior from the blending, misorder, or something else entirely. Any ideas as to what could be causing this?