Kaynağa Gözat

added Params.defaultKillAlphaThreshold and make textureShader accessible in MeshMaterial

Nicolas Cannasse 11 yıl önce
ebeveyn
işleme
445cf3d161

+ 1 - 1
h3d/mat/MeshMaterial.hx

@@ -3,7 +3,7 @@ package h3d.mat;
 class MeshMaterial extends Material {
 
 	var mshader : h3d.shader.BaseMesh;
-	var textureShader : h3d.shader.Texture;
+	public var textureShader(default, null) : h3d.shader.Texture;
 	public var texture(get,set) : h3d.mat.Texture;
 
 	public var color(get, set) : Vector;

+ 2 - 0
h3d/pass/Params.hx

@@ -2,6 +2,8 @@ package h3d.pass;
 
 class Params {
 
+	public static var defaultKillAlphaThreshold = 0.5;
+
 	@:isVar public static var shadowShader(get, set) : hxsl.Shader;
 
 	// delay initialization if needed only

+ 1 - 1
h3d/shader/Texture.hx

@@ -33,7 +33,7 @@ class Texture extends hxsl.Shader {
 	public function new(?tex) {
 		super();
 		this.texture = tex;
-		killAlphaThreshold = 0.5;
+		killAlphaThreshold = h3d.pass.Params.defaultKillAlphaThreshold;
 	}
 
 }

+ 1 - 0
h3d/shader/Texture2.hx

@@ -36,6 +36,7 @@ class Texture2 extends hxsl.Shader {
 	public function new(?tex) {
 		super();
 		this.texture = tex;
+		this.killAlphaThreshold = h3d.pass.Params.defaultKillAlphaThreshold;
 	}
 
 }