ncannasse 11 anni fa
parent
commit
f677105924
1 ha cambiato i file con 20 aggiunte e 0 eliminazioni
  1. 20 0
      h3d/shader/KillAlpha.hx

+ 20 - 0
h3d/shader/KillAlpha.hx

@@ -0,0 +1,20 @@
+package h3d.shader;
+
+class KillAlpha extends hxsl.Shader {
+
+	static var SRC = {
+
+		@param var threshold : Float;
+		var pixelColor : Vec4;
+
+		function fragment() {
+			if( pixelColor.a < threshold ) discard;
+		}
+	}
+
+	public function new(threshold = 0.) {
+		super();
+		this.threshold = threshold;
+	}
+
+}