From ef94e43af1f16c112c74a0158847a76c9bfb745e Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Tue, 29 Dec 2015 01:30:45 -0400 Subject: [PATCH] Fixed Shader:sendColor incorrectly converting alpha from sRGB to linear RGB when gamma-correct rendering is enabled. --- src/modules/graphics/opengl/wrap_Shader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/graphics/opengl/wrap_Shader.cpp b/src/modules/graphics/opengl/wrap_Shader.cpp index 21a33bf29..e121ad20a 100644 --- a/src/modules/graphics/opengl/wrap_Shader.cpp +++ b/src/modules/graphics/opengl/wrap_Shader.cpp @@ -184,7 +184,7 @@ static int w__Shader_sendFloat(lua_State *L, bool colors) for (int j = 0; j < (int) dimension; j++) { // the fourth component (alpha) is always already linear, if it exists. - if (gammacorrect && i < 4) + if (gammacorrect && j < 3) values[i * dimension + j] = m.gammaToLinear(values[i * dimension + j] / 255.0f); else values[i * dimension + j] /= 255.0f;