100
100
// Get the anti-aliased and resolution independent shape mask using distance fields.
101
101
lowp float distanceMin = abs(dist) * -distanceAA + 0.5;
102
102
lowp float distanceMax = abs(dist) * distanceAA + 0.5;
104
105
// Get the shadow color outside of the shape mask.
105
106
lowp float shadow = (shapeData.b * -mask) + shapeData.b; // -ab + a = a(1 - b)
106
107
// Mask the current color then blend the shadow over the resulting color. We simply use