diff options
Diffstat (limited to 'src/Runtime/res/effectlib/distancefieldtext_core.frag')
-rw-r--r-- | src/Runtime/res/effectlib/distancefieldtext_core.frag | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/Runtime/res/effectlib/distancefieldtext_core.frag b/src/Runtime/res/effectlib/distancefieldtext_core.frag index 0f848bc1..bf60f874 100644 --- a/src/Runtime/res/effectlib/distancefieldtext_core.frag +++ b/src/Runtime/res/effectlib/distancefieldtext_core.frag @@ -5,10 +5,9 @@ out vec4 fragColor; uniform sampler2D _qt_texture; uniform vec4 color; -in vec2 alphas; - void main() { - fragColor = color * smoothstep(alphas.x, alphas.y, - texture(_qt_texture, sampleCoord).r); + float distance = texture(_qt_texture, sampleCoord).r; + float f = fwidth(distance); + fragColor = color * smoothstep(0.5 - f, 0.5, distance); } |