ncannasse 11 ani în urmă
părinte
comite
f677105924
1 a modificat fișierele cu 20 adăugiri și 0 ștergeri
  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;
+	}
+
+}