3d: Implement MESH_BOTH attribute

It disables back-face culling.
This commit is contained in:
kichikuou
2024-10-20 08:16:27 +09:00
parent abd3a276a3
commit 4e04db0045
+5
View File
@@ -436,11 +436,16 @@ static void render_model(struct RE_instance *inst, struct RE_renderer *r, enum d
glBindVertexArray(mesh->vao);
if (mesh->flags & MESH_BOTH)
glDisable(GL_CULL_FACE);
if (mesh->nr_indices)
glDrawElements(GL_TRIANGLES, mesh->nr_indices, GL_UNSIGNED_SHORT, NULL);
else
glDrawArrays(GL_TRIANGLES, 0, mesh->nr_vertices);
if (mesh->flags & MESH_BOTH)
glEnable(GL_CULL_FACE);
glBindVertexArray(0);
glBindTexture(GL_TEXTURE_2D, 0);
}