~zsombi/ubuntu-ui-toolkit/listitemSelectModeBugs

« back to all changes in this revision

Viewing changes to src/Ubuntu/Components/plugin/shaders/shapeoverlay.frag

  • Committer: Zsombor Egri
  • Date: 2015-11-16 06:35:05 UTC
  • mfrom: (1664.1.1 listitemSelectModeBugs)
  • Revision ID: zsombor.egri@canonical.com-20151116063505-cwn2qfks7qzk10g9
re-sync

Show diffs side-by-side

added added

removed removed

Lines of Context:
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;
103
 
        lowp float mask = smoothstep(distanceMin, distanceMax, shapeData[yCoord <= 0.0 ? 0 : 1]);
 
103
        lowp int shapeSide = yCoord <= 0.0 ? 0 : 1;
 
104
        lowp float mask = smoothstep(distanceMin, distanceMax, shapeData[shapeSide]);
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