Recent build problems: IllegalStateException: Scene graph is not properly updated for rendering

Hi all,



I just downloaded yesterday’s build and keep on receiving a java.lang.IllegalStateException: Scene graph is not properly updated for rendering. exception. Never had this problem prior to now (I have been using last month’s build before). The problem seems to be with the node that contains the parts of my game sky that are to be reflected by the water.



Make sure scene graph state was not changed after rootNode.updateGeometricState() call.

Problem spatial name: Sky Reflection
.



For reference, my update method looks as follows:

[java]public void simpleUpdate(float tpf) {

try {

sky.update(cam);

for (Vessel.VesselDataUpdater vdu : registeredUpdaters) {

vdu.run();

}

super.simpleUpdate(tpf);

rootNode.updateGeometricState();

} catch (ConcurrentModificationException cme) {

cme.printStackTrace();

}

}[/java]



And here my reflection:

[java]Sky skyReflection = new Sky(assetManager, “assets/Textures/Sky/sky_reflection.jpg”);

skyReflectionNode.attachChild(skyReflection.getSkyGeometry());

ocean = Ocean.getOceanInstance(assetManager, inputManager, skyReflectionNode);



viewPort.addProcessor(ocean.getWaterProcessor());[/java]



Any thoughts as to what’s going wrong? Thanks :slight_smile:

I dont think you need the sky.update() thing. I dont quite get what you are trying to do and where that error happens exactly… Try putting the “rootNode.updateGeometricState();” at the beginning of simpleUpdate(). Its called automatically after simpleUpdate anyway.

I have a similar problem as well, where I use simpleapplication and it is telling me the same error, for the moment I just outcommented the checking where the exception comes from and everything seems to work as intended.

EmpirePhoenix said:
I have a similar problem as well, where I use simpleapplication and it is telling me the same error, for the moment I just outcommented the checking where the exception comes from and everything seems to work as intended.

You're definitely doing it wrong :P

@normen. Try putting the “rootNode.updateGeometricState();” at the beginning of simpleUpdate(). already tried that. Removed sky.update() (although I believe its required) – no luck still.

@EmpirePhoenix: Calling skyReflectionNode.updateGeometricState(); did the job. Although something’s still broke: My ocean turns black at times :s



EDIT: i.e. Sky skyReflection = new Sky(assetManager, “assets/Textures/Sky/sky_reflection.jpg”);

skyReflectionNode.attachChild(skyReflection.getSkyGeometry());

skyReflectionNode.updateGeometricState();

ocean = Ocean.getOceanInstance(assetManager, inputManager, skyReflectionNode);

Mhh, lightning is odd too: my lights are no longer “lights” but “anti-lights” :stuck_out_tongue: That is, my light source makes everything darker…

Dont call updateGeomtericState on a Spatial with a parent! Is skyReflectionNode the rootNode in another viewPort? If not the call you make is illegal.

Yup, I know. But it’s the only thing that does the trick :stuck_out_tongue:

That cannot be. If you call updateGeometricState() on the rootNode this spatial is attached to you get the same effect.

“you call updateGeometricState() on the rootNode this spatial is attached to you get the same effect.”

I tried that, but it doesn’t. Calling rootNode.updateGeometricState() results in the same exceptions being thrown…

It simply cannot be, look at the code. Then the skyReflectionNode is not part of the same scenegraph or you have messed up the updateGeometricState() call by overriding it in some selfmade spatial.

Yes, I surely have made a mess somewhere. However it worked before. skyReflectionNode was part of the scene. And I haven’t overridden updateGeometric anywhere. However I have now made skyReflectionNode to be a separate node (as it contains nodes that should be reflected by the ocean but not rendered in the main scene). The problem with my water turning black randomly persists…

The water problem could be due to the fact that the water implementation is not done yet. It reflects also meshes that are below the water. Any chance that could be it?

That’s probably it. It worked fine with previous builds however. Oh well, time will tell :wink: I’ll play around with it and see what happens.