FIX: Swap sorting of hexmodel indices to make hexmodel frontface not backface

This commit is contained in:
sebastian 2026-02-08 09:31:25 +01:00
parent e1c03db182
commit 29511deef7
3 changed files with 1 additions and 2 deletions

BIN
assets/hex/white.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -18,7 +18,6 @@ void TerrainRenderer::renderTerrainTiles(const std::unordered_map<TexturedModel
prepareTexturedModel(*texturedModel);
for (const auto& hexTile : batch) {
prepareInstance(*hexTile);
printf("Render terrain Tile at %f, %f, %f!\n", hexTile->position.x, hexTile->position.y, hexTile->position.z);
glDrawElements(GL_TRIANGLES, texturedModel->getRawModel()->vertexCount, GL_UNSIGNED_INT, 0);
}
unbindTexturedModel();

View File

@ -41,8 +41,8 @@ RawModel HexModelFactory::createHexRawModel(Loader &loader, float radius) {
for (int i = 1; i <= 6; ++i) {
indices.push_back(0);
indices.push_back(i);
indices.push_back(i % 6 + 1);
indices.push_back(i);
}
return loader.loadToVAO(vertices, normals, uvs, indices);