mirror of
https://github.com/xivdev/Penumbra.git
synced 2026-01-02 13:53:42 +01:00
Add tri count per LoD to models tab
Adds the tri count of each LoD on the selected model to the Models tab under Advanced Editing.
This commit is contained in:
parent
384b8fd489
commit
0ad769e08e
1 changed files with 17 additions and 0 deletions
|
|
@ -508,6 +508,11 @@ public partial class ModEditWindow
|
|||
ImGuiUtil.DrawTableColumn(file.VertexDeclarations.Length.ToString());
|
||||
ImGuiUtil.DrawTableColumn("Stack Size");
|
||||
ImGuiUtil.DrawTableColumn(file.StackSize.ToString());
|
||||
for (var lod = 0; lod < file.Lods.Length; lod++)
|
||||
{
|
||||
ImGuiUtil.DrawTableColumn("LoD " + lod + " Triangle Count");
|
||||
ImGuiUtil.DrawTableColumn(GetTriangleCountForLod(file, lod).ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -555,6 +560,18 @@ public partial class ModEditWindow
|
|||
return file != null;
|
||||
}
|
||||
|
||||
private static long GetTriangleCountForLod(MdlFile model, int lod)
|
||||
{
|
||||
var vertSum = 0u;
|
||||
var meshIndex = model.Lods[lod].MeshIndex;
|
||||
var meshCount = model.Lods[lod].MeshCount;
|
||||
|
||||
for (var i = meshIndex; i < meshIndex + meshCount; i++)
|
||||
vertSum += model.Meshes[i].IndexCount;
|
||||
|
||||
return vertSum / 3;
|
||||
}
|
||||
|
||||
private static readonly string[] ValidModelExtensions =
|
||||
[
|
||||
".gltf",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue