LOD for version 3 (14 posts)

Topic tags: LOD
  • Profile picture of thegamerm thegamerm said 1 year, 5 months ago:

    Do anyone plan to implement LOD for models in jme3? I plan to port my project from ogre to jme. It seems only think missing is LOD.

    Thank you.

    M.H.

  • Profile picture of nehon nehon590p said 1 year, 5 months ago:

    Lod IS implemented in JME3.
    Look at the jme3test.stress.TestLodStress.

  • Profile picture of Momoko_Fan Momoko_Fan366p said 1 year, 5 months ago:

    You need to use jMP‘s “Advanced Model Conversion” to generate LOD for an OgreXML model.

  • Profile picture of thegamerm thegamerm said 1 year, 5 months ago:

    Is there any way to progressively reduce the mesh size on the fly? TestLodStress example used for only the models that have precalculated lod levels.

    Thank you
    M.H.

  • Profile picture of normen normen1271p said 1 year, 5 months ago:

    It sounds convenient for a programmer but in the end its not really the way to go. JME3 has no such classes atm.

  • Profile picture of Momoko_Fan Momoko_Fan366p said 1 year, 5 months ago:

    Most progressive mesh reduction algorithms are rather slow since they require constant bandwidth use between the GPU and CPU. Its much faster to just render the mesh without LOD in that case.

  • Profile picture of thegamerm thegamerm said 1 year, 5 months ago:

    Momoko_Fan said:
    Most progressive mesh reduction algorithms are rather slow since they require constant bandwidth use between the GPU and CPU. Its much faster to just render the mesh without LOD in that case.

    Good point. however what i was trying to do is loading the model generating the LOD levels then presenting to the user. LOD generation for a model may take a couple of seconds but this is acceptable in my case. The problem is i want to generate LOD levels on the fly.

    By the way i tried “Advanced Model Conversion” to an ogre.mesh.xml how ever i am still getting “LOD levels are not set error”. any suggestions?

    Thank you all for your replies.
    I am working on a research project and the project has now been ported to the jmonkeyengine.

  • Profile picture of Momoko_Fan Momoko_Fan366p said 1 year, 5 months ago:

    You need to specify the # of LOD levels and % reduction. It won’t generate any if # of LOD levels is 0. Also make sure you’re loading the result J3O model and not the mesh.xml one.

  • Profile picture of johncl johncl13p said 6 months, 2 weeks ago:

    How would one go about manually creating a Node with different LOD models? For example a simple sphere where I create 3 spheres, a detailed one with 50×50 vertices, another with 25×25 and a simple one with 5×5 – and then set the distance from the camera where the transitions should happen? I cannot find an example for this kind of programming.

    I want to create my own models on the fly through mesh generators and can in many cases easily create LOD levels of these as well. I know the Terrain does something like this? So perhaps that code would explain it. Hmm… gotta check that out.

  • Profile picture of InShadow InShadow15p said 6 months, 2 weeks ago:

    Surely that would be amazing feature to have. :)

  • Profile picture of johncl johncl13p said 6 months, 2 weeks ago:

    Now that I think of it, I guess it should be possible to make a LODNode that extends Node that keeps track of different LOD version Node’s with a distance vector, and just adjusting its “children” nodes according to their distance to the viewer (is updateLogicalState called every frame as an update?). It would need to know the camera object for the view.

    Possibly also a LODNodeControl could be created that does the same on update, although it would have to call attachChild/removeChild children to the node it controls depending on viewing distance. That would trigger a lot of refreshing in the Node that is probably unecessary as the object is in the same boundary but with a different geometry. An additional Node class might be the simplest way to reduce CPU load.

  • Profile picture of Momoko_Fan Momoko_Fan366p said 6 months, 2 weeks ago:

    To use the built-in LOD in jME3 you need to use the Mesh.setLodLevels() method. You pass it an array of index buffers, each index buffer has less triangles than the one before it. When you use LodControl, it automatically chooses an appropriate index buffer to use based on the number of triangles it has and the model’s size on the screen

  • Profile picture of johncl johncl13p said 6 months, 2 weeks ago:

    Ah, so you pass it a full set of indexes for all the different types? Cool, so you get a complete set of new normals, texture coords and can reuse the mesh vertices. Ok will have to try that out. Do you know if billboard LOD is used much in addition to mesh LODs today? Just wondering if I should bother, or just try to optimize the mesh for each LOD step. I see that a good “imposter” as they are called have many images depending on view angle which means I would have to render the object at different angles onto a texture to auto generate these.

    Btw I also saw an article about a more advanced form for imposter on the Nvidia site:

    http://http.developer.nvidia.com/GPUGems3/gpugems3_ch21.html

    This sounds like a very cool feature as it “only” requires 6 images from each direction of a cube and does some cool trickery to generate an imposter based on these. I was thinking of trying something similar but where I just fade between 6 different quad images depending on view angle (where up to 3 will be seen at the same time at varying intensity). Not sure if it will look any good though, but the idea was to use it for distant objects only.

  • Profile picture of Momoko_Fan Momoko_Fan366p said 6 months, 2 weeks ago:

    We use index buffer based LOD because Ogre3D uses it and it’s pretty easy to load it from the model file. All LOD algorithms require offline prepfocessing of some sort and we haven’t implemented such framework in jME3 yet. Importers work great for instances of the same model, e.g trees and such