Well as the comparision says, JME3 is able to load models in a sepreate thread, so my main question is what do I have to take care of when doing it this way?
My idea is just that I have some kinda of background loader that I can pass a modelname + a node that should it be attached. Then the game continues while the Background loads the model, once finished it should be added to the node passed.
Possible problems I see
Loading textures/shaders for the model might result in problems (at least it did in JME2 it should work now i guess)
Attaching the child out of another Thread directly into the node might cause problems if it is rendering at the smae time?
The first frame the model appears a lag happens when the textures are uploaded to the opengl vram.
Yep, the TextureManager is one of the problems in my multi-displaysystem jme2 implementation (which is running btw, but still has a bunch of potential thread-safety issues due to statics everywhere).
I think that one way to solve the problem is to use threadlocals inside the TextureManager, or use one TextureManager for each DisplaySystem.
I would really like to switch all my current JME2 based work (3D broadcast video engine) to JME3 but I feel it's a bit too fresh. I don't know.
I was able to load models with textures etc. on a different thread in jme2 already..
You can load textures from another thread, but you can't load them from multiple threads simultaneously, since TextureManager is not thread-safe in jME2.
I have recently commented out the multithreaded-based loading in jME3, it became incompatible to the many changes that happened with asset handling. The best way to do it is probably to have a preload list, that tells all resources that shall be loaded, then these resources are loaded in multiple threads depending on how many cores the machine has, you would then receive notifications in the OpenGL thread telling you that a resource has finished loading and needs handling.
I was able to load models with textures etc. on a different thread in jme2 already… The attaching to the scenegraph might be something you want to do on the OpenGL thread, but loading, I think its no problem at all…
I would really like to switch all my current JME2 based work (3D broadcast video engine) to JME3 but I feel it's a bit too fresh. I don't know.
Yes, jme3's structure is still not set in stone, so basing a project on it right now is not really recommended. But if you try around with it.. any feedback is very welcome and will help get jme3 out sooner.
Can someone give me an example of loading models by multithread ? Since i’m really not familiar with the multithreading programmation it seems to be very important on complex game in JME like what i have …
i can’t read german >< do you have any example to give me ?
i’m doing a 3D RPG and i’m pretty sure that i have to program on multi thread i really need to know how it works in JAVA please and especially with JME3
And how do you assetManager.loadModel() on a separate thread ?
When i attach to OpenGl Thread what does it invovled ? Does it mean it will work at the begining of the compilation ? Or is there a way to control the thread and tell it to execute only at this time ? Is that even possible to makes priority thread ?