Browse Source

Fixed Shader:sendColor incorrectly converting alpha from sRGB to linear RGB when gamma-correct rendering is enabled.

Alex Szpakowski 9 years ago
parent
commit
ef94e43af1
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/modules/graphics/opengl/wrap_Shader.cpp

+ 1 - 1
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++)
 			for (int j = 0; j < (int) dimension; j++)
 			{
 			{
 				// the fourth component (alpha) is always already linear, if it exists.
 				// 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);
 					values[i * dimension + j] = m.gammaToLinear(values[i * dimension + j] / 255.0f);
 				else
 				else
 					values[i * dimension + j] /= 255.0f;
 					values[i * dimension + j] /= 255.0f;