ソースを参照

Revert HMDOut changes

TothBenoit 1 年間 前
コミット
3ea742d2f2
5 ファイル変更2 行追加85 行削除
  1. 1 34
      hxd/fmt/fbx/HMDOut.hx
  2. 0 9
      hxd/fmt/hmd/Data.hx
  3. 0 21
      hxd/fmt/hmd/Reader.hx
  4. 0 20
      hxd/fmt/hmd/Writer.hx
  5. 1 1
      hxsl/CacheFileBuilder.hx

+ 1 - 34
hxd/fmt/fbx/HMDOut.hx

@@ -772,39 +772,7 @@ class HMDOut extends BaseLibrary {
 			var model = new Model();
 			var ref = o.skin == null ? o : o.skin;
 
-			var modelName = o.model == null ? null : o.model.getName();
-			if (modelName != null) {
-				var lodNameIdx = modelName.indexOf("LOD");
-				if (lodNameIdx >= 0) {
-					if (modelName.indexOf("LOD") + 3 > modelName.length)
-						throw 'Missing LOD index for model ${modelName}';
-
-					var idx = modelName.indexOf("LOD") + 3;
-					while (idx < modelName.length && Std.parseInt(modelName.substr(idx, 1)) != null)
-						idx++;
-
-					var lodIdx = Std.parseInt(modelName.substr(lodNameIdx + 3, idx));
-
-					if (modelName.charAt(lodNameIdx - 1)  == '_')
-						lodNameIdx--;
-					if (modelName.charAt(idx) == '_')
-						idx++;
-
-					modelName = StringTools.replace(modelName, modelName.substr(lodNameIdx, idx), "");
-
-					var g = getChild(o.model, "Geometry");
-					var lod = new Lod();
-					lod.name = '${modelName}_LOD${lodIdx}';
-					lod.idx = lodIdx;
-					lod.geom = buildGeom(new hxd.fmt.fbx.Geometry(this, g), null, dataOut, false).g;
-					d.lods.push(lod);
-
-					if (lodIdx != 0)
-						continue;
-				}
-			}
-
-			model.name = modelName;
+			model.name = o.model == null ? null : o.model.getName();
 			model.parent = o.parent == null || o.parent.isJoint ? -1 : o.parent.index;
 			model.follow = o.parent != null && o.parent.isJoint ? o.parent.model.getName() : null;
 			var m = ref.model == null ? new hxd.fmt.fbx.BaseLibrary.DefaultMatrixes() : getDefaultMatrixes(ref.model);
@@ -1197,7 +1165,6 @@ class HMDOut extends BaseLibrary {
 		d.models = [];
 		d.animations = [];
 		d.shapes = [];
-		d.lods = [];
 
 		dataOut = new haxe.io.BytesOutput();
 

+ 0 - 9
hxd/fmt/hmd/Data.hx

@@ -90,14 +90,6 @@ class BlendShape {
 	}
 }
 
-class Lod {
-	public var name:String;
-	public var idx:Int;
-	public var geom:Geometry;
-
-	public function new() {}
-}
-
 class Material {
 
 	public var name : String;
@@ -212,7 +204,6 @@ class Data {
 	public var models : Array<Model>;
 	public var animations : Array<Animation>;
 	public var shapes : Array<BlendShape>;
-	public var lods : Array<Lod>;
 	public var dataPosition : Int;
 	public var data : haxe.io.Bytes;
 

+ 0 - 21
hxd/fmt/hmd/Reader.hx

@@ -248,27 +248,6 @@ class Reader {
 				s.remapPosition = i.readInt32();
 				d.shapes.push(s);
 			}
-
-			var lodLength = i.readInt32();
-			d.lods = [];
-			for (k in 0...lodLength) {
-				var lod = new Lod();
-				lod.name = readName();
-				lod.idx = i.readInt32();
-
-				lod.geom = new Geometry();
-				lod.geom.props = readProps();
-				lod.geom.vertexCount = i.readInt32();
-				lod.geom.vertexFormat = makeFormat();
-				lod.geom.vertexPosition = i.readInt32();
-				var subCount = i.readByte();
-				if( subCount == 0xFF ) subCount = i.readInt32();
-				lod.geom.indexCounts = [for( k in 0...subCount ) i.readInt32()];
-				lod.geom.indexPosition = i.readInt32();
-				lod.geom.bounds = readBounds();
-
-				d.lods.push(lod);
-			}
 		}
 
 

+ 0 - 20
hxd/fmt/hmd/Writer.hx

@@ -210,26 +210,6 @@ class Writer {
 			out.writeInt32(s.remapPosition);
 		}
 
-		out.writeInt32(d.lods.length);
-		for (lod in d.lods) {
-			writeName(lod.name);
-			out.writeInt32(lod.idx);
-			
-			writeProps(lod.geom.props);
-			out.writeInt32(lod.geom.vertexCount);
-			writeFormat(lod.geom.vertexFormat);
-			out.writeInt32(lod.geom.vertexPosition);
-			if( lod.geom.indexCounts.length >= 0xFF ) {
-				out.writeByte(0xFF);
-				out.writeInt32(lod.geom.indexCounts.length);
-			} else
-				out.writeByte(lod.geom.indexCounts.length);
-			for( i in lod.geom.indexCounts )
-				out.writeInt32(i);
-			out.writeInt32(lod.geom.indexPosition);
-			writeBounds(lod.geom.bounds);
-		}
-
 		var bytes = header.getBytes();
 		out = old;
 

+ 1 - 1
hxsl/CacheFileBuilder.hx

@@ -201,7 +201,7 @@ class CacheFileBuilder {
 			var serializeRootSignature = @:privateAccess dx12Driver.stringifyRootSignature(sign.sign, "ROOT_SIGNATURE", sign.params, sign.paramsCount);
 			code = serializeRootSignature + code;
 			sys.io.File.saveContent(tmpSrc, code);
-			var args = ["-rootsig-define", "ROOT_SIGNATURE", "-T", ( (rd.kind == Vertex) ? "vs_" : "ps_") + dxcShaderVersion,"-O3","-Zi", "-Fd", "C:\\Projects\\ShadersPDB\\","-Fo", tmpOut, tmpSrc];
+			var args = ["-rootsig-define", "ROOT_SIGNATURE", "-T", ( (rd.kind == Vertex) ? "vs_" : "ps_") + dxcShaderVersion,"-O3","-Fo", tmpOut, tmpSrc];
 			var p = new sys.io.Process(Sys.getEnv("GXDKLatest")+ "bin\\Scarlett\\dxc.exe", args);
 			var error = p.stderr.readAll().toString();
 			var ecode = p.exitCode();