graphics: Rename color_matrix -> color_matrix_body

This commit is contained in:
Hajime Hoshi 2018-06-06 02:46:54 +09:00
parent b86860abcc
commit e6d0943366
2 changed files with 3 additions and 3 deletions

View File

@ -299,7 +299,7 @@ func (s *openGLState) useProgram(proj []float32, texture opengl.Texture, dst, sr
esBody, esTranslate := colorM.UnsafeElements()
if !areSameFloat32Array(s.lastColorMatrix, esBody) {
c.UniformFloats(program, "color_matrix", esBody)
c.UniformFloats(program, "color_matrix_body", esBody)
if s.lastColorMatrix == nil {
s.lastColorMatrix = make([]float32, 16)
}

View File

@ -73,7 +73,7 @@ precision mediump float;
{{Definitions}}
uniform sampler2D texture;
uniform mat4 color_matrix;
uniform mat4 color_matrix_body;
uniform vec4 color_matrix_translation;
uniform highp vec2 source_size;
@ -148,7 +148,7 @@ void main(void) {
color.rgb /= color.a;
}
// Apply the color matrix
color = (color_matrix * color) + color_matrix_translation;
color = (color_matrix_body * color) + color_matrix_translation;
color = clamp(color, 0.0, 1.0);
// Premultiply alpha
color.rgb *= color.a;