2
0
TothBenoit 5 сар өмнө
parent
commit
0b44a214b8

+ 3 - 1
h3d/shader/KillAlpha.hx

@@ -8,7 +8,9 @@ class KillAlpha extends hxsl.Shader {
 		var pixelColor : Vec4;
 
 		function fragment() {
-			if( pixelColor.a < threshold ) discard;
+			// Put the result of the check in a var. This way the DCE can correctly say that only the alpha channel of pixelColor is needed.
+			var doDiscard = pixelColor.a < threshold;
+			if( doDiscard ) discard;
 		}
 	}