This commit is contained in:
2023-02-22 18:05:20 +02:00
parent b66976e029
commit 1a0709d113
2 changed files with 16 additions and 7 deletions

View File

@@ -661,10 +661,17 @@ namespace Game
if (mesh.vertices.Count == 0)
continue;
geom.model.LODs[0].Meshes[i].UpdateMesh(mesh.vertices, mesh.indices, mesh.normals,
null, mesh.uvs);
geom.model.LODs[0].Meshes[i].MaterialSlotIndex = i;
geom.model.MaterialSlots[i].Material = geom.meshes[i].material;
var tassk = Task.Run(() =>
{
List<int> indices = new List<int>();
foreach (var ind in mesh.indices)
indices.Add((int)ind);
geom.model.LODs[0].Meshes[i].UpdateMesh(mesh.vertices.ToArray(), indices.ToArray(), mesh.normals.ToArray() /*,
null, mesh.uvs*/);
geom.model.LODs[0].Meshes[i].MaterialSlotIndex = i;
geom.model.MaterialSlots[i].Material = geom.meshes[i].material;
});
tassk.Wait();
}
//Not supported yet, should be done here
@@ -1106,8 +1113,10 @@ namespace Game
}
//for (int i=0; i<10000; i++)
// Debug.Log($"{i} udfghjosa fuhoag guiha7 2382835yayhahn0 generate:{generateSdf}, GI:{Graphics.PostProcessSettings.GlobalIllumination.Mode != GlobalIlluminationMode.None}, {sdfModels.Count}");
/*for (int i=0; i<10000; i++)
{
Debug.Log($"{i} udfghjosa fuhoag guiha7 2382835yayhahn0 generate:{generateSdf}, GI:{Graphics.PostProcessSettings.GlobalIllumination.Mode != GlobalIlluminationMode.None}, {sdfModels.Count}");
}*/
//Debug.Log($"generate:{generateSdf}, GI:{Graphics.PostProcessSettings.GlobalIllumination.Mode != GlobalIlluminationMode.None}, {sdfModels.Count}");
if (generateSdf && globalIllumination /*&& Graphics.PostProcessSettings.GlobalIllumination.Mode != GlobalIlluminationMode.None*/ && sdfModels.Count > 1)