Merge pull request #942 from ousttrue/fix/DIVIDE_VERTEX_BUFFER

DIVIDE_VERTEX_BUFFER がすごい遅い
This commit is contained in:
ousttrue
2021-05-13 18:36:52 +09:00
committed by GitHub

View File

@@ -38,6 +38,7 @@ namespace UniGLTF
for (int i = 0; i < mesh.subMeshCount; ++i)
{
var indices = mesh.GetIndices(i);
var hash = new HashSet<int>(indices);
// mesh
// index の順に attributes を蓄える
@@ -45,7 +46,7 @@ namespace UniGLTF
usedIndices.Clear();
for (int k = 0; k < positions.Length; ++k)
{
if (indices.Contains(k))
if (hash.Contains(k))
{
// indices から参照される頂点だけを蓄える
usedIndices.Add(k);