LWJGL Renderer Error

Guys, I’ve been struggling with this error for a while. It’s happening on the rendering thread whenever I try to attach spatials to the rootNode. I think I’m doing everything safely (on the rendering thread). What kind of error is that? can anyone give me more information?





[java]

EVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]

java.lang.AssertionError

at com.jme3.scene.Spatial.updateWorldTransforms(Spatial.java:453)

at com.jme3.scene.Geometry.updateWorldTransforms(Geometry.java:292)

at com.jme3.scene.Spatial.updateGeometricState(Spatial.java:683)

at com.jme3.scene.Node.updateGeometricState(Node.java:177)

at com.jme3.scene.Node.updateGeometricState(Node.java:177)

at com.jme3.scene.Node.updateGeometricState(Node.java:177)

at com.jme3.app.SimpleApplication.update(SimpleApplication.java:249)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:149)

at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:182)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:223)

at java.lang.Thread.run(Unknown Source)

[/java]

Somehow the parent is not refreshed, when do you attach? Somehow its not in the right moment in the update loop. And judging by the line numbers you are not using the latest version of jME.

Edit: or do you use getLocalTranslation().set() or similar somewhere?

well my app is an animator of a trace file, and I have a button that when clicked restarts the animation by detaching all nodes from rootNode and then re-read the trace file , and then re-attaching them to the rootNode - it used to work fine… I dk why all of a sudden it stopped working.



All of the above is done on the rendering thread except the trace parsing is done on its own thread.



No unfortunately I’m not using the latest version for several other reasons.

1 Like

Why don’t you assign to a boolean in some class that the animation must be restarted, then in the update loop check the boolean and replay the animation there? The rendering thread wont restart the animation at the same time as the update loop is ready to, err, render i think

well I am using cinematics, and what I do I create a new Cinematic, isn’t that the same?

How I understand it, you are attaching spatials to the rootNode in a seperate thread, out of simpleUpdate?



EDIT: No, you need to attach your spatials from the update loop, as normen said they are not being attached at the right moment in the update loop, how I would get round this is not to directly attach to the rootNode when the buttons are pressed, but to check every frame whether the animations need to be restarted, then you know that the spatials are being attached at the right moment :wink:



EDIT: Oh! then I cant help you :frowning:

1 Like

true but of course I attach them safely by enqueing them to the render thread and not attach them directly

u still working with that same trace file?

The code in Spatial has changed since the version you are running so I can’t be sure of what the actual assertion is but it looks like you are somehow modifying your attached spatials outside of the update() pass.



So, either you’ve subclassed Node/Spatial/Etc. and they are doing something wrong. Or you are editing the scene graph outside of the update() unintentionally.



There’s really no other way for this to happen. So it’s a matter of finding where in your code that is doing that.



If it’s the assertion I think it is then it means that the child is being asked to update world transforms and the parent’s world transforms are not updated. In normal operation, this can’t happen unless the parent was invalidated as part of child processing or is being modified from another thread.



Hmmm… that is an interesting point. Do your children have controls that modify parent transforms?



Edit: except that’s a different pass… so that shouldn’t cause an issue either. Badly behaved subclasses or modifications from another thread are the only things I can think of.



Edit 2: unless you have controls that modify their parents in controlRender(). You can’t do that, by the way.



Edit 3: that’s also a separate pass.

1 Like

I thought detaching from rootNode is not considered as unsafe for the rendering thread, I am now detaching nodes safely from the rootNode (this is happening on other threads so now I am enqueuing it)



that seems to have solved the issue

@garnaout said:
I thought detaching from rootNode is not considered as unsafe for the rendering thread, I am now detaching nodes safely from the rootNode (this is happening on other threads so now I am enqueuing it)

that seems to have solved the issue

How can "any scene graph-related operation" make you think that :? Really, its *everything* for an attached spatial.
1 Like
@garnaout said:
I thought detaching from rootNode is not considered as unsafe for the rendering thread, I am now detaching nodes safely from the rootNode (this is happening on other threads so now I am enqueuing it)

that seems to have solved the issue


You cannot modify the scene graph from another thread. This includes adding, removing, updating, changing location, changing material colors, changing material parameters... basically ANY OPERATION that in ANY way MODIFIES the attached scene graph, ie: the visual representation changes at all: MUST be done on the render thread.

Hopefully that covers all of the bases.
2 Likes