LOD for version 3

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.

Lod IS implemented in JME3.

Look at the jme3test.stress.TestLodStress.

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

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.

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

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.

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.

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.

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 50x50 vertices, another with 25x25 and a simple one with 5x5 - 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.

Surely that would be amazing feature to have. :slight_smile:

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.

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

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.

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

Hi, so there is no algorithm to calculate a simplified version of a loaded model (so with a lower LOD) when the model is loaded. So this would not have to be realtime, I only want to reduce the LOD if I detect a to high LOD :wink: This would be realy useful in an scenario where a user can select a model to load which has a unnessecary high LOD…

@simon.heinen said: Hi, so there is no algorithm to calculate a simplified version of a loaded model (so with a lower LOD) when the model is loaded. So this would not have to be realtime, I only want to reduce the LOD if I detect a to high LOD ;) This would be realy useful in an scenario where a user can select a model to load which has a unnessecary high LOD..
Yes, you can load ogre models with the advanced importer (right-click the mesh.xml in the assets folder) and add lod levels automatically.

But you are talking about the JME SDK right? What i ment was that the user of my application selects a 3d model file in the application and this is then loaded and different lod meshes are calculated automatically.

@simon.heinen said: But you are talking about the JME SDK right? What i ment was that the user of my application selects a 3d model file in the application and this is then loaded and different lod meshes are calculated automatically.
Yeah well then you'd have to reinvent that wheel too I guess and do the same.
@normen said:
@simon.heinen said: But you are talking about the JME SDK right? What i ment was that the user of my application selects a 3d model file in the application and this is then loaded and different lod meshes are calculated automatically.
Yeah well then you'd have to reinvent that wheel too I guess and do the same.

So its not a good additional feature for the existing model loaders? If you already implemented the algorithms why not automatically create the lod meshes for objects which are loaded when a lod calculation flag is set or some concept like that? Or a separate component which takes a geometry and generates the different lod geomentries?

@simon.heinen said: So its not a good additional feature for the existing model loaders? If you already implemented the algorithms why not automatically chread the lod meshes for objects which are loaded when a lod calculation flag is set or some concept like that? Or a separate component which takes a geometry and generates the different log geomentries?
Its a feature of the ogre command line converter which is built into the SDK.