summaryrefslogtreecommitdiffstats
path: root/res/effectlib/distancefieldtext_dropshadow_core.frag
diff options
context:
space:
mode:
Diffstat (limited to 'res/effectlib/distancefieldtext_dropshadow_core.frag')
-rw-r--r--res/effectlib/distancefieldtext_dropshadow_core.frag8
1 files changed, 4 insertions, 4 deletions
diff --git a/res/effectlib/distancefieldtext_dropshadow_core.frag b/res/effectlib/distancefieldtext_dropshadow_core.frag
index e13182e..8e8c61d 100644
--- a/res/effectlib/distancefieldtext_dropshadow_core.frag
+++ b/res/effectlib/distancefieldtext_dropshadow_core.frag
@@ -12,16 +12,16 @@ void main()
clamp(shadowSampleCoord,
normalizedTextureBounds.xy,
normalizedTextureBounds.zw)).r;
- float shadowDistanceD = fwidth(shadowDistance);
- float shadowAlpha = smoothstep(0.5 - shadowDistanceD, 0.5, shadowDistance);
+ float shadowDistanceD = fwidth(shadowDistance) * 0.5;
+ float shadowAlpha = smoothstep(0.5 - shadowDistanceD, 0.5 + shadowDistanceD, shadowDistance);
vec4 shadowPixel = color * shadowColor * shadowAlpha;
float textDistance = texture(_qt_texture,
clamp(sampleCoord,
normalizedTextureBounds.xy,
normalizedTextureBounds.zw)).r;
- float textDistanceD = fwidth(textDistance);
- float textAlpha = smoothstep(0.5 - textDistanceD, 0.5, textDistance);
+ float textDistanceD = fwidth(textDistance) * 0.5;
+ float textAlpha = smoothstep(0.5 - textDistanceD, 0.5 + textDistanceD, textDistance);
vec4 textPixel = color * textAlpha;
fragOutput = mix(shadowPixel, textPixel, textPixel.a);