Trying to switch to 16 bit indices

This commit is contained in:
Dynamitos
2024-04-06 08:29:15 +02:00
parent 505e7d6547
commit 7a713afdb4
12 changed files with 81 additions and 99 deletions
+4 -1
View File
@@ -258,9 +258,12 @@ void MeshLoader::loadGlobalMeshes(const aiScene* scene, const Array<PMaterialIns
vertexData->loadBiTangents(id, biTangents);
vertexData->loadColors(id, colors);
Array<uint32> indices(mesh->mNumFaces * 3);
Array<uint16> indices(mesh->mNumFaces * 3);
for (size_t faceIndex = 0; faceIndex < mesh->mNumFaces; ++faceIndex)
{
assert(mesh->mFaces[faceIndex].mIndices[0] < std::numeric_limits<uint16>::max());
assert(mesh->mFaces[faceIndex].mIndices[1] < std::numeric_limits<uint16>::max());
assert(mesh->mFaces[faceIndex].mIndices[2] < std::numeric_limits<uint16>::max());
indices[faceIndex * 3 + 0] = mesh->mFaces[faceIndex].mIndices[0];
indices[faceIndex * 3 + 1] = mesh->mFaces[faceIndex].mIndices[1];
indices[faceIndex * 3 + 2] = mesh->mFaces[faceIndex].mIndices[2];