Importing more complex Scenes: > 10.000 Poly

Hi guys
I’ve been reading up on JME for 3 days now. In theory it’s exactly what I want. But I am having trouble importing scenes from Blender.

My scene has ca. 10k Quads and 4.7MB Textures. I have increased the memory usage: -J-Xms512m -J-Xmx512m -J-XX:PermSize=256m -J-XX:MaxDirectMemorySize=2048m"
Any higher values will cause JME not to start.
Now I really don’t think I am exceeding this memory with my simple scene, but I get message: OutOfMemory Direct buffer memory.
But the import model is processing, but not getting anywhere.

I deleted all textures from the blend file (not something I’m happy about) and then tried to reattach them with code. I loaded the generated myBlendFile.j3o But now I need to know how to access (get) the subobjects of the scene like “crane” mesh and their materials to reapply the textures.
Any ideas are greatly appreciated.

Open the .j3o file in the scene viewer, you should be able to select a mesh in the Scene Explorer Window (By default, it can be found down left). Then, add a material in the Properties Window. Through this material, you should be able to add a texture. I don’t know what you have to do in order to do this with UV textures, sorry.

You increawse all kinds of memory but not directmemory, it has another parameter

Thank you both very much.
@Din
That is very good to know.
@Empire Phoenix
2048 seemed a high enough number. I put it 3000 4096 didn’t start. Still seems odd to me that you have to be close to the mem limit for a simple scene like mine. I still can’t preview my model in the OpenGL window, but I can load it into an app.

Is it good practice to load other models separately now. E.g. I want to have 4 Instances of a model (which is currently not in the scene). I should do that by code, or does the converter recognize instances? OGRE seems to do so.

Have you tryed splitting your scene into chunks then loading them seperatly? For instance if your scene has ground and buildings split the model into one containing the ground and several others containing each building thus allowing you to load models that have a much lower polycount. It pry isn’t the solution you are looking for but I have had to do this myself.

Well I suggest to try jvisualvm in profiling mode for memory to determine what is actually using all that memory, 10k quads and a few textures should be nothing at all. (As i use several million and half gigabyte textures sometimes)

Thanks again
When I press “import model” the surviving generations jump to over 100%
When I press “open model” the Used Heap increases slightly to ca 100MB, which is still in the lower 5th of the available Heap. Then I get the error message, the Heap goes back to where it was.
during the entire process the overall RAM usage does not increase and the CPU never jumps over 25%.

after googling a lot > 100% surviving generations seems to be a lot of garbage to me. But I have no idea, why it occurs without me running a custom class, or before I even chose a model, nor how to fix it.
btw the same error occurs on another computer, both win7 64bit, one Quad, one dual core.

EDIT: if I get this correctly http://www.munzandmore.com/2011/ora/memleak the surviving generations should cause the heap mem to increase over time, this does not seem to be the case.

Hm is it possible that you post a small testcase with your model? Something seems to be really strange.


After a while the heap starts climbing also.

I’ve now done the following:
Monitor everything (see attached jpg).
Deleted all previous projects (in Jmonkey), including source files.

Saved the scene in v. 2.63 (oldest Blender supporting bMesh)
Created a new blank scene and appended only the important meshes.
joined all the meshes together.
Nothing worked.

I created a scene with cubes in a 20x20x20 Array, causing 48k faces, 1 Texture -> no problem.
So I’ll try a little more to find the irregularity inside Blender and let you know if I find something or post my scene, if I don’t.

I added everything to my testscene that I thought could be a source of error. So far I found one severe problem: If you have a set of vertex colors on a model, it will fail to import. The scene now get’s displayed properly in the model preview, but when I click finish Jmonkey fails to convert the scene to .j3o, same error

I haven’t read abot the vert. col. anywhere, so If I didn’t miss it, you might want to add it to the creating assets in Blender sheet. (just a suggestion,) I’ll keep searching and you posted.

http://bioillustration.de/importFail.blend
I have isolated one of the models. The scene as it I uploaded it fails to import. I would appreciate if anyone could try it on their machines.
Thanks

OK, I found the error with the file above as well: the scale was not applied. Appearently scales that are the same for x, y and z are fine, but if the scale is say: x: 0.5, z: 0.5, z: 1 it will fail to import. So my bad. Unfortunately my scene still doesn’t import, so I’ll keep looking.

1 Like

Well the file above works fine for me to import.

http://bioillustration.de/importFail2.blend
Oh, I guess that’s bad news for me.
I have attached another one. Seems to me if I delete one of the objects, it imports fine, but I mus be over my limit when I add one more model, could you try that one, too?

I just saw: Even with models that do load the surviving generations jump to 100%, I’ll try reinstalling jmonkey

Works fine as well, only need around 100mb ram at all.