Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 97a2215e authored by Lucas Dupin's avatar Lucas Dupin Committed by Automerger Merge Worker
Browse files

Merge "Fix sparkle alpha blending" into sc-dev am: 1cc81e18

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14459592

Change-Id: I0dd342a07fcc00abca6c9f689fb8739e68e115ca
parents ae50a224 1cc81e18
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -113,10 +113,11 @@ final class RippleShader extends RuntimeShader {
            + "    float sparkle = sparkles(densityUv, in_noisePhase) * ring * alpha "
            + "* turbulence;\n"
            + "    float fade = min(fadeIn, 1. - fadeOutRipple);\n"
            + "    vec4 circle = in_color * (softCircle(p, center, in_maxRadius "
            + "      * scaleIn, 0.2) * fade);\n"
            + "    float circleAlpha = softCircle(p, center, in_maxRadius * scaleIn, 0.2) * fade;\n"
            + "    vec3 color = mix(in_color.rgb, in_sparkleColor.rgb, sparkle);\n"
            + "    float mask = in_hasMask == 1. ? sample(in_shader, p).a > 0. ? 1. : 0. : 1.;\n"
            + "    return mix(circle, in_sparkleColor, sparkle) * mask;\n"
            + "    float a = (in_color.a * circleAlpha + in_sparkleColor.a * sparkle) * mask;\n"
            + "    return vec4(color * a, a);\n"
            + "}";
    private static final String SHADER = SHADER_UNIFORMS + SHADER_LIB + SHADER_MAIN;
    private static final double PI_ROTATE_RIGHT = Math.PI * 0.0078125;