While I understand the concept of LOD, I'm having a little trouble implementing it. Assume I have a number of models at different LODs and I want to store them in my Mesh class. What do I need to change (I already have a Mesh supporting one model). Do I have multiple VBOs (an array, with index dictating level perhaps?), buffer each model into it's VBO and bind the correct one when rendering? Or am I completely missing the idea?
Asked
Active
Viewed 4,165 times
1
-
1The technicalities are basically left to you. I would probably write each model into it's own buffer. Seems cleaner. The way you could implement it is easy: you probably have some sort of `Draw()` function that issues opengl to render your model. Before you do so, you check the distance between the camera eye and the model's position. If it's larger than a certain amount, you render the low-resolution model. If it's close enoug, you render the full-resolution model. And tadaa, you've implemented distance-based model LOD. – s3rius Aug 09 '14 at 00:30
1 Answers
4
What do I need to change
It really depends how you structure your vertices or indices. There are a thousand ways to achieve level of detail for models. You could as s3rius described, hold each LOD model in its own vertex buffer. Alternatively, depending on how you order your triangles or vertices, you can keep 1 vertex buffer and skip along the indices when you draw the triangles for varying quality.
For example, when you want full level of detail, you would render every vertex of the model. When you want half as much detail, you would render every other vertex.
Check out some of the links posted here. LOD in modern games Always read up on modern practices.