From 85b97d19d302e55c2f767f5c45bb34527206a328 Mon Sep 17 00:00:00 2001 From: AnyOldName3 Date: Wed, 17 Oct 2018 14:02:26 +0100 Subject: [PATCH] Add alpha threshold for shadow casting. --- files/shaders/shadowcasting_fragment.glsl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/files/shaders/shadowcasting_fragment.glsl b/files/shaders/shadowcasting_fragment.glsl index 6459467b1..00b8f9aa1 100644 --- a/files/shaders/shadowcasting_fragment.glsl +++ b/files/shaders/shadowcasting_fragment.glsl @@ -14,4 +14,8 @@ void main() gl_FragData[0].a = texture2D(diffuseMap, diffuseMapUV).a * alphaPassthrough; else gl_FragData[0].a = alphaPassthrough; + + // Prevent translucent things casting shadow (including the player using an invisibility effect) + if (gl_FragData[0].a < 0.5) + discard; }