Forráskód Böngészése

moved h3d.pass.Params to h3d.mat.Defaults

ncannasse 9 éve
szülő
commit
db3c623236
5 módosított fájl, 14 hozzáadás és 8 törlés
  1. 0 1
      h3d/impl/Driver.hx
  2. 4 2
      h3d/impl/Stage3dDriver.hx
  3. 8 3
      h3d/mat/Defaults.hx
  4. 1 1
      h3d/mat/Material.hx
  5. 1 1
      h3d/shader/Texture.hx

+ 0 - 1
h3d/impl/Driver.hx

@@ -60,7 +60,6 @@ enum Feature {
 class Driver {
 
 	public var logEnable : Bool;
-	public var loadingTextureColor = 0xFFFF00FF;
 
 	public function hasFeature( f : Feature ) {
 		return false;

+ 4 - 2
h3d/impl/Stage3dDriver.hx

@@ -576,8 +576,10 @@ class Stage3dDriver extends Driver {
 		case Textures:
 			for( i in 0...curShader.s.fragment.textures2DCount + curShader.s.fragment.texturesCubeCount ) {
 				var t = buffers.fragment.tex[i];
-				if( t == null || t.isDisposed() )
-					t = h3d.mat.Texture.fromColor(loadingTextureColor,(loadingTextureColor>>>24)/255);
+				if( t == null || t.isDisposed() ) {
+					var color = h3d.mat.Defaults.loadingTextureColor;
+					t = h3d.mat.Texture.fromColor(color,(color>>>24)/255);
+				}
 				if( t != null && t.t == null && t.realloc != null ) {
 					t.alloc();
 					t.realloc();

+ 8 - 3
h3d/pass/Params.hx → h3d/mat/Defaults.hx

@@ -1,8 +1,9 @@
-package h3d.pass;
+package h3d.mat;
 
-class Params {
+class Defaults {
 
 	public static var defaultKillAlphaThreshold = 0.5;
+	public static var loadingTextureColor = 0xFFFF00FF;
 
 	@:isVar public static var shadowShader(get, set) : hxsl.Shader;
 
@@ -17,4 +18,8 @@ class Params {
 		return shadowShader = s;
 	}
 
-}
+	public dynamic static function makeVolumeDecal( bounds : h3d.col.Bounds ) : hxsl.Shader {
+		return new h3d.shader.VolumeDecal(bounds.xSize, bounds.ySize);
+	}
+
+}

+ 1 - 1
h3d/mat/Material.hx

@@ -115,7 +115,7 @@ class Material {
 	function set_receiveShadows(v) {
 		if( v == receiveShadows )
 			return v;
-		var shadows = h3d.pass.Params.shadowShader;
+		var shadows = h3d.mat.Defaults.shadowShader;
 		if( v )
 			mainPass.addShader(shadows);
 		else

+ 1 - 1
h3d/shader/Texture.hx

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