Apply vertex offset to indices
Fixes rendering for other models like sponza Refs #677
This commit is contained in:
parent
05b2fbfb24
commit
3763e001dc
1 changed files with 3 additions and 1 deletions
|
|
@ -313,6 +313,8 @@ private:
|
|||
bool hasColor = aMesh->HasVertexColors(0);
|
||||
bool hasNormals = aMesh->HasNormals();
|
||||
|
||||
const uint32_t vertexOffset = static_cast<uint32_t>(vertices.size());
|
||||
|
||||
for (uint32_t v = 0; v < aMesh->mNumVertices; v++)
|
||||
{
|
||||
Vertex vertex;
|
||||
|
|
@ -330,7 +332,7 @@ private:
|
|||
{
|
||||
for (uint32_t j = 0; j < 3; j++)
|
||||
{
|
||||
indices.push_back(aMesh->mFaces[f].mIndices[j]);
|
||||
indices.push_back(vertexOffset + aMesh->mFaces[f].mIndices[j]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue