summaryrefslogtreecommitdiffstats
path: root/src/Runtime/res/effectlib/distancefieldtext_dropshadow_core.frag
diff options
context:
space:
mode:
Diffstat (limited to 'src/Runtime/res/effectlib/distancefieldtext_dropshadow_core.frag')
-rw-r--r--src/Runtime/res/effectlib/distancefieldtext_dropshadow_core.frag32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/Runtime/res/effectlib/distancefieldtext_dropshadow_core.frag b/src/Runtime/res/effectlib/distancefieldtext_dropshadow_core.frag
new file mode 100644
index 00000000..304b1874
--- /dev/null
+++ b/src/Runtime/res/effectlib/distancefieldtext_dropshadow_core.frag
@@ -0,0 +1,32 @@
+in vec2 sampleCoord;
+in vec2 shadowSampleCoord;
+in vec4 normalizedTextureBounds;
+
+out vec4 fragColor;
+
+uniform sampler2D _qt_texture;
+uniform vec4 color;
+uniform vec4 shadowColor;
+
+in vec2 alphas;
+
+void main()
+{
+ float shadowAlpha = smoothstep(alphas.x,
+ alphas.y,
+ texture(_qt_texture,
+ clamp(shadowSampleCoord,
+ normalizedTextureBounds.xy,
+ normalizedTextureBounds.zw)).r);
+ vec4 shadowPixel = shadowColor * shadowAlpha;
+
+ float textAlpha = smoothstep(alphas.x,
+ alphas.y,
+ texture(_qt_texture,
+ clamp(sampleCoord,
+ normalizedTextureBounds.xy,
+ normalizedTextureBounds.zw)).r);
+ vec4 textPixel = color * textAlpha;
+
+ fragColor = mix(shadowPixel, textPixel, textPixel.a);
+}