Make square particles gamma-correct, work around Intel Windows bug

I guess it makes sense to apply gamma to the color, we do the same
for the standard round particles.
Also, this way the fragment shader for square particles references the
uniCommon UBO (gamma is part of it) - apparently the Intel HD4000
(from Ivy Bridge) GPU driver for Windows has a bug that uniform blocks
that exist in the shader source but aren't actually used can't be found
(with glGetUniformBlockIndex(prog, name)), which we treat as an error
in  gl3_shaders.c initShader3D().

fixes #391
This commit is contained in:
Daniel Gibson 2019-04-25 18:38:16 +02:00
parent 0ef064b21d
commit 98b24654b6

View file

@ -703,7 +703,12 @@ static const char* fragmentSrcParticlesSquare = MULTILINE_STRING(
void main() void main()
{ {
outColor = passColor; // outColor = passColor;
// so far we didn't use gamma correction for square particles, but this way
// uniCommon is referenced so hopefully Intels Ivy Bridge HD4000 GPU driver
// for Windows stops shitting itself (see https://github.com/yquake2/yquake2/issues/391)
outColor.rgb = pow(passColor.rgb, vec3(gamma));
outColor.a = passColor.a;
} }
); );