FIX: Swap sorting of hexmodel indices to make hexmodel frontface not backface
This commit is contained in:
parent
e1c03db182
commit
29511deef7
BIN
assets/hex/white.png
Normal file
BIN
assets/hex/white.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
@ -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();
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user