blob: 2236f9cd769b05df1fc370681d00ba0fb5dc26e5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#ifdef GL_OES_standard_derivatives
# extension GL_OES_standard_derivatives : enable
#else
# define use_fallback
#endif
varying highp vec2 sampleCoord;
uniform sampler2D _qt_texture;
uniform highp vec4 color;
#ifdef use_fallback
varying highp vec2 alphas;
#endif
void main()
{
highp float distance = texture2D(_qt_texture, sampleCoord).a;
#ifdef use_fallback
highp float alpha = smoothstep(alphas.x, alphas.y, distance);
#else
highp float f = fwidth(distance) * 0.5;
highp float alpha = smoothstep(0.5 - f, 0.5 + f, distance);
#endif
gl_FragColor = color * alpha;
}
|