LOD Generation on very simple models

Hi guys,
sorry if a thread to this topic does already exist, search didn’t found a really helpful one.

In my game I am using a very low poly tree model (68 triangles) but since I want to have a very far view range lots of them (about 1000-1500) can be attached to the scene at the same time. The auto LOD generation tool in the sdk did not help me very much. It could not reduce the triangles to less than 57. I understand that it is not designed for objects so simple but in my case a reduction to 10 -15 triangles would be helpful (very far trees do not need to be more than a green cone). Is there a way to create a costum lod model in the normal tree model or do I have to use an extra model with an own distance check control?

I am sure others had that problem too, how did you solve it? :wink:

On the screenshot you see what I mean with distance trees: It’s useless that the model still contains the trunk.


Not really an answer to your question. But 68 triangles isn’t that much, I think the problem is the object count. Batch them or if on JME 3.1, you can use instanced node.

At least on code level you can add your own LOD models. I don’t know if the Blender importer supports that, or Blender itself.

I am working with JME 3.0 (is 3.1 already a good option?). I will have a look at object batching. Never used it though but I guess I can learn it :wink:

Probably if you are just starting a project, it makes sense to start it with 3.1. As then you avoid the possible migration later.

From what I understand the instanced node might be more suitable for this kind of case than batching. But both provides first aid at least. BatchNode is what you are looking for, if going for batching. I’m not sure if the shadows will break the batching down again. Watch the object count.

1 Like

We began our project with jme 3.0 as 3.0 was in beta.
3.1 will probably be stable enough to begin a project with it and make a post on the forums if you run into a bug.

Mh… It’s already three weeks of work I don’t want to lose. Guess I try to migrate to 3.1. Is there any tutorial or something how to do it?

I doubt it will be much work. I don’t know how industrious you are, but if you are just done some basic things…

Just download and try to get your code to compile.

Hi again,
I migrated to JME 3.1 now (with only a few problems finding the right libraries for the classpath) and now I have the same scene with 20 fps more :smile:

Now I want to use the instanced node (in the description it sounds great!) but I can’t find any tutorial or anything how to use it. If you had a link for me I would be so happy :wink:

Thank you so far, already helped me a lot!

Sorry to be a party pooper, but InstancedNode will probably not help you much here. 68 triangles is nothing, you’re being limited by # of objects here.

Since trees don’t move much (if any), you should be able to batch them easily. I recommend splitting the map into a grid and then batching the trees within that grid slots, so you take advantage of spatial culling and reduced object count simultaneously.

I am currently using a grid of TerrainQuads and another grid of nodes to hold trees (and later other objects), one per TerrainQuad but not attached to it. I think I can batch them easily when they are at a specific distance to the camera (I guess that is what I should do?) First time I am using this, so a noobish question: Can they simply be “unbatched”, for example if the player comes closer and the scene might change? I am thinking of TerrainQuad and its “setLocked()” method. Is this the same?

Thank you again :slight_smile:

EDIT: Now I am using a BatchNode instead of a normal node and batch it after adding the trees (brought another 20 fps). Can I just remove the trees and batch again like I would do in a normal node?

EDIT2: Aaand… shadows are gone :smiley: Best I find a way to have it only batched when it is far away from the camera and missing shadows are no problem.

Oh sorry, I mislead you a bit with the instancing :cold_sweat: I thought it too would reduce the object count.

No problem, somehow I can do it :smiley:

You may need to set the shadow mode on the batch node itself.

That makes sense…