Explorar o código

Update FixedColor shader

ShiroSmith %!s(int64=6) %!d(string=hai) anos
pai
achega
e87b671b9f
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      h3d/shader/FixedColor.hx

+ 4 - 1
h3d/shader/FixedColor.hx

@@ -4,9 +4,11 @@ class FixedColor extends hxsl.Shader {
 
 	static var SRC = {
 		@param var color : Vec4;
+		@const @param var USE_ALPHA : Bool;
 		var output : { color : Vec4 };
 		function fragment() {
-			output.color = color;
+			output.color.rgb = color.rgb;
+			if( USE_ALPHA ) output.color.a = color.a;
 		}
 	}
 
@@ -14,6 +16,7 @@ class FixedColor extends hxsl.Shader {
 		super();
 		this.color.setColor(color);
 		this.color.w = alpha;
+		USE_ALPHA = true;
 	}
 
 }