indice-aware calculate_tangents

This commit is contained in:
milek7
2020-10-19 15:04:03 +02:00
parent 5b50a39610
commit 6a48293a40
5 changed files with 19 additions and 15 deletions

View File

@@ -685,8 +685,8 @@ std::pair<int, int> TSubModel::Load( cParser &parser, bool dynamic )
}
}
Vertices.resize( m_geometry.vertex_count ); // in case we had some degenerate triangles along the way
gfx::calculate_tangents( Vertices, GL_TRIANGLES );
gfx::calculate_indices( Indices, Vertices );
gfx::calculate_tangents( Vertices, Indices, GL_TRIANGLES );
// update values potentially changed by indexing
m_geometry.index_count = Indices.size();
m_geometry.vertex_count = Vertices.size();