浏览代码

add normal and depth pass

bstouls 9 年之前
父节点
当前提交
44514711fe
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      h3d/scene/World.hx

+ 4 - 1
h3d/scene/World.hx

@@ -39,7 +39,7 @@ class WorldMaterial {
 		shadows = true;
 	}
 	public function updateBits() {
-		bits = (t.t.id << 6) | (blend.getIndex() << 3) | ((killAlpha == null ? 0 : 1)<<2) | ((lights ? 1 : 0)<<1) | (shadows ? 1 : 0);
+		bits = (t.t.id << 6) | (blend.getIndex() << 3) | ((killAlpha == null ? 0 : 1) << 2) | ((lights ? 1 : 0) << 1) | (shadows ? 1 : 0);
 	}
 }
 
@@ -117,6 +117,7 @@ class World extends Object {
 
 	function loadMaterialTexture( r : hxd.res.FbxModel, mat : hxd.fmt.hmd.Data.Material ) : WorldMaterial {
 		var texturePath = r.entry.directory + mat.diffuseTexture.split("/").pop();
+
 		var m = textures.get(texturePath);
 		if( m != null )
 			return m;
@@ -259,6 +260,8 @@ class World extends Object {
 		mesh.material.textureShader.killAlphaThreshold = mat.killAlpha;
 		mesh.material.mainPass.enableLights = mat.lights;
 		mesh.material.shadows = mat.shadows;
+		mesh.material.allocPass("normal");
+		mesh.material.allocPass("depth");
 	}
 
 	override function dispose() {