Hello everyone,
I’m currently creating a open-world game with java using LWJGL 3. My engine is already capable of loading objects from .obj files. I do this by storing the vertex coordinates in a Vertex Buffer Object(VBO), the texture coordinates in a VBO and the normals in a VBO and bind them to a Vertex Array Object(VAO).
Now i’m trying to create some sort of Level of Detail in my engine so that the objects rendered at a greater distance are rendered with less vertices than the objects rendered at a smaller distance. I was thinking about doing this with the Edge Collapse algorithm. This algorithm searches the model for the smallest edge between vertices and collapses the 2 vertices so that they become 1 verteex. I want 5 Level of Details where 0 is the original object, 1 is a object with less vertices and so on.
At the moment I was thinking to create the first VAO for the 0 level of detail. then calculate the vertex coordinates, texture coordinates and normals for the next Level of Detail and store them into a second VAO and do this 4 times for every Level of Detail. Then dynamically choose the VAO to render relative to the distance.
Is this a good way to do it or is it better to create multiple .obj models for every level and just load them in, or is there even a better way to solve this problem?