[tilemap] add bias to verts to avoid cracks

This commit is contained in:
Green Sky 2022-02-17 18:54:11 +01:00
parent 60aca24ec6
commit 9ff0b17a5e

View File

@ -43,6 +43,12 @@ Tilemap::Tilemap(MM::Engine& engine) {
-0.5f, 0.5f,
};
// bias to avoid cracks
const float vert_offset_fact = 1.001f;
for (size_t i = 0; i < 2 * 6; i++) {
vertices[i] *= vert_offset_fact;
}
_vertexBuffer = std::make_unique<MM::OpenGL::Buffer>(vertices, 2 * 6 * sizeof(float), GL_STATIC_DRAW);
_vao = std::make_unique<MM::OpenGL::VertexArrayObject>();
_vao->bind();