jME3 Alpha4 problems with placing many trees in golf simulation (SharedNode / DiscreteLodNode missin

Hello Guys,

I’m involved in developing a 3D Golf Simulation Software based on the current jME3 Alpha 4.

Now I am at a point where I got 2 Problems related to placing many tree models all over the golf course.



First Problem:

I have to place many trees, so there will be a large amount of memory be used. In jME2 there was the possibilty

to use SharedNodes. In jME3 the SharedNode Class is missing. Whats the alternative in jME3 Alpha 4 to

place many tree objects avoiding object redundancy?



2nd Problem:

In jME2 there was a class called DiscreteLodNode which is missing at jME3. It gave me the possibility to set different

models for one treemodel in dependcy of the Camera Distance to the Model

e.g. For one tree I have 3 different quality models (highPol, medPol, lowPol)

I need to use different quality models because of performance issues.

Can anybody tell me how I can realize this in jME3 without the DiscreteLodNode class?



thanking you in anticipation!

M. Weiss

  1. All models laodeed with assetmanager are automatically shared where applicable.
  2. Use a ogrexml model with different lod data, and there is a controller that handles the switching.(one of the testcases does this, can’t remember wich one tho)

Thanks EmpirePhoenix for that fast response.

I’ll try it immediately !



greetings

M. Weiss

@all:The first questions is answered. But I have still problems to find a solution for my 2nd problem.



@EmpirePhoenix: I tried to find the matching JmeTest for an example with that Lod Data of a OgreXML Model but I failed.

Could you remember in which category of these tests that example was?



What I already tried was to add a LodControl to the tree Spatial. But then I got an error: “LodControl could only be added to Geometry objects





greetz

M. Weiss

Lod meshes have to be generated (in JMP just double click on a mesh.xml file and set the # of lod level to at least 1), then you’ll have to use the lodControl over this loaded model.



We talked sometime ago of a way to specify by code a lod level mesh, this feature will eventually be implemented.

btw the test case for lod is this one http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/stress/TestLodStress.java

Note that the lod levels for the teapot has been generated using the method described above.

Hi nehon,



thanks for your response! It was very helpful. But now I got a new problem in JMP setting LOD Levels

on the appropriate tree mesh. When I start to apply the new Settings (create tangents is set && LOD Levels with value 3) with the Import button, the JMP starts the ‘Converting OgreXML’ process and freezes at 50% with the status: “Unregistering ResourceManager for type Mesh



And after a while I get also an Java Exception called:

“java.lang.NullPointerException at com.jme3.gde.ogretools.convert.AdvOgreXMLConvertAction$1.run(AdvOgreXMLConvertAction.java:62) [catch] at java.lang.Thread.run(Thread.java:662)”



When I try the same procedure with meshes from the testdata there is no problem with the converting process. So whats wrong with my mesh? Why does it freeze?





greetings

M. Weiss

@all: Got the Solution for the 2nd Problem.

Special thanks to EmpirePhoenix and nehon for the fast help.



The solution for the problem was to export each mesh of the tree seperate (in Blender).

Then there was no problem with setting LOD Level and converting it to .j3o file.

For using large amount of trees, i’d suggest using the GeometryBatchFactory, and clump them together to reduce the object count.

If they have lods, you can use it together with the method described here: http://hub.jmonkeyengine.org/groups/contribution-depot-jme3/forum/topic/lods-for-geometrybatchfactory/

to lod your batches.