I'm trying to implement LOD to boost my game's performance. I found a very nice tutorial.

The basic concept that I think I understand is: Get the distance from the camera to the object, check for the right LOD-level and then render the object with the "right amount of instances".

How do I implement that? The provided example code is a mystery to me...

Some questions:

  1. Is this a good method to implement LOD?
  2. Can someone please explain me detailed, how I have to implement it, with the queries and so on...
  3. I'm rendering all of my objects with

    GL11.glDrawElements(GL11.GL_TRIANGLES, model.getRawModel().getVertexCount(),
                        GL11.GL_UNSIGNED_INT, 0);

    The example code uses GL_POINTS. Can I implement it also with GL_TRIANGLES?

  • \$\begingroup\$ This is a good way of implementing LODS for huge amounts of instances (Computes are also great for this). Do you have a already CPU based LOD system ? Here GL_POINTS is only used to dispatch some number of GS, not for actual rendering (This article is 7 years old, a modern implementation would probably use compute shaders instead). \$\endgroup\$ – gan_ Jun 15 '18 at 9:40

I guess it depends how you have set up your rendering already, assuming you're using an indicie array to draw your vertices in your terrain then you can simply create more indicie arrays to draw with, stepping along more verts with each array.


Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.