mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-26 02:42:02 +01:00
graphics: Rename color_matrix -> color_matrix_body
This commit is contained in:
parent
b86860abcc
commit
e6d0943366
@ -299,7 +299,7 @@ func (s *openGLState) useProgram(proj []float32, texture opengl.Texture, dst, sr
|
|||||||
esBody, esTranslate := colorM.UnsafeElements()
|
esBody, esTranslate := colorM.UnsafeElements()
|
||||||
|
|
||||||
if !areSameFloat32Array(s.lastColorMatrix, esBody) {
|
if !areSameFloat32Array(s.lastColorMatrix, esBody) {
|
||||||
c.UniformFloats(program, "color_matrix", esBody)
|
c.UniformFloats(program, "color_matrix_body", esBody)
|
||||||
if s.lastColorMatrix == nil {
|
if s.lastColorMatrix == nil {
|
||||||
s.lastColorMatrix = make([]float32, 16)
|
s.lastColorMatrix = make([]float32, 16)
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ precision mediump float;
|
|||||||
{{Definitions}}
|
{{Definitions}}
|
||||||
|
|
||||||
uniform sampler2D texture;
|
uniform sampler2D texture;
|
||||||
uniform mat4 color_matrix;
|
uniform mat4 color_matrix_body;
|
||||||
uniform vec4 color_matrix_translation;
|
uniform vec4 color_matrix_translation;
|
||||||
|
|
||||||
uniform highp vec2 source_size;
|
uniform highp vec2 source_size;
|
||||||
@ -148,7 +148,7 @@ void main(void) {
|
|||||||
color.rgb /= color.a;
|
color.rgb /= color.a;
|
||||||
}
|
}
|
||||||
// Apply the color matrix
|
// 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);
|
color = clamp(color, 0.0, 1.0);
|
||||||
// Premultiply alpha
|
// Premultiply alpha
|
||||||
color.rgb *= color.a;
|
color.rgb *= color.a;
|
||||||
|
Loading…
Reference in New Issue
Block a user