Merge "Fix boot animation alpha multiplication computations" into tm-qpr-dev
This commit is contained in:
@@ -132,14 +132,14 @@ static const char IMAGE_FRAG_DYNAMIC_COLORING_SHADER_SOURCE[] = R"(
|
|||||||
uniform sampler2D uTexture;
|
uniform sampler2D uTexture;
|
||||||
uniform float uFade;
|
uniform float uFade;
|
||||||
uniform float uColorProgress;
|
uniform float uColorProgress;
|
||||||
uniform vec4 uStartColor0;
|
uniform vec3 uStartColor0;
|
||||||
uniform vec4 uStartColor1;
|
uniform vec3 uStartColor1;
|
||||||
uniform vec4 uStartColor2;
|
uniform vec3 uStartColor2;
|
||||||
uniform vec4 uStartColor3;
|
uniform vec3 uStartColor3;
|
||||||
uniform vec4 uEndColor0;
|
uniform vec3 uEndColor0;
|
||||||
uniform vec4 uEndColor1;
|
uniform vec3 uEndColor1;
|
||||||
uniform vec4 uEndColor2;
|
uniform vec3 uEndColor2;
|
||||||
uniform vec4 uEndColor3;
|
uniform vec3 uEndColor3;
|
||||||
varying highp vec2 vUv;
|
varying highp vec2 vUv;
|
||||||
void main() {
|
void main() {
|
||||||
vec4 mask = texture2D(uTexture, vUv);
|
vec4 mask = texture2D(uTexture, vUv);
|
||||||
@@ -152,12 +152,12 @@ static const char IMAGE_FRAG_DYNAMIC_COLORING_SHADER_SOURCE[] = R"(
|
|||||||
* step(cWhiteMaskThreshold, g)
|
* step(cWhiteMaskThreshold, g)
|
||||||
* step(cWhiteMaskThreshold, b)
|
* step(cWhiteMaskThreshold, b)
|
||||||
* step(cWhiteMaskThreshold, a);
|
* step(cWhiteMaskThreshold, a);
|
||||||
vec4 color = r * mix(uStartColor0, uEndColor0, uColorProgress)
|
vec3 color = r * mix(uStartColor0, uEndColor0, uColorProgress)
|
||||||
+ g * mix(uStartColor1, uEndColor1, uColorProgress)
|
+ g * mix(uStartColor1, uEndColor1, uColorProgress)
|
||||||
+ b * mix(uStartColor2, uEndColor2, uColorProgress)
|
+ b * mix(uStartColor2, uEndColor2, uColorProgress)
|
||||||
+ a * mix(uStartColor3, uEndColor3, uColorProgress);
|
+ a * mix(uStartColor3, uEndColor3, uColorProgress);
|
||||||
color = mix(color, vec4(vec3((r + g + b + a) * 0.25), 1.0), useWhiteMask);
|
color = mix(color, vec3((r + g + b + a) * 0.25), useWhiteMask);
|
||||||
gl_FragColor = vec4(color.x, color.y, color.z, (1.0 - uFade)) * color.a;
|
gl_FragColor = vec4(color.x, color.y, color.z, (1.0 - uFade));
|
||||||
})";
|
})";
|
||||||
static const char IMAGE_FRAG_SHADER_SOURCE[] = R"(
|
static const char IMAGE_FRAG_SHADER_SOURCE[] = R"(
|
||||||
precision mediump float;
|
precision mediump float;
|
||||||
@@ -1440,12 +1440,12 @@ void BootAnimation::initDynamicColors() {
|
|||||||
for (int i = 0; i < DYNAMIC_COLOR_COUNT; i++) {
|
for (int i = 0; i < DYNAMIC_COLOR_COUNT; i++) {
|
||||||
float *startColor = mAnimation->startColors[i];
|
float *startColor = mAnimation->startColors[i];
|
||||||
float *endColor = mAnimation->endColors[i];
|
float *endColor = mAnimation->endColors[i];
|
||||||
glUniform4f(glGetUniformLocation(mImageShader,
|
glUniform3f(glGetUniformLocation(mImageShader,
|
||||||
(U_START_COLOR_PREFIX + std::to_string(i)).c_str()),
|
(U_START_COLOR_PREFIX + std::to_string(i)).c_str()),
|
||||||
startColor[0], startColor[1], startColor[2], 1 /* alpha */);
|
startColor[0], startColor[1], startColor[2]);
|
||||||
glUniform4f(glGetUniformLocation(mImageShader,
|
glUniform3f(glGetUniformLocation(mImageShader,
|
||||||
(U_END_COLOR_PREFIX + std::to_string(i)).c_str()),
|
(U_END_COLOR_PREFIX + std::to_string(i)).c_str()),
|
||||||
endColor[0], endColor[1], endColor[2], 1 /* alpha */);
|
endColor[0], endColor[1], endColor[2]);
|
||||||
}
|
}
|
||||||
mImageColorProgressLocation = glGetUniformLocation(mImageShader, U_COLOR_PROGRESS);
|
mImageColorProgressLocation = glGetUniformLocation(mImageShader, U_COLOR_PROGRESS);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user