JME3 Performance


I’d like to get a small discussion going about jme3 and performance.

The reason is i’m having a fairly small scene. It’s 30x30 quads (not a terrain). Each tile may have some batched vegetation, consisting of up to 3, crossed, dual sided quads (all made “static”). Most of the objects use the “lighting material” without any spec or normal maps. The terrain is an exception, using a custom shader (using a couple of layers of color mix(), no vertex manipulation ).

The scene is made up of a Sector(“World”), with the “tiles” as children, and any vegetation or objects on the tiles are children of the tile.

On top is a PSSM filter.

A typical screen (not scene) might have 1600 objects, 97k tri’s and 111k vertices. (Which sounds alot to me, for what i can see). Still, it shouldn’t be too much to handle for a modern computer. But I’m seeing framerates of between 20-30 fps.

Coming from the content side of development, my experience from optimizing consists mostly of removing things. There isn’t much to remove in my scene though, so i’d like to see if there’s anything i should think of, and if there’s anything that’s going to happen on the engine side that will improve things in the future.

Also, is there an easy way to profile what each component costs?

Any advice welcome.


I do not have access to your project, but if I was having massive slowdowns, I would take a step back and analyze each piece of my project to see how much of a performance hit I was getting and see where optimizations could be made.

Perhaps go through and analyze each piece of your project and record what kind of framerate gains you get.

Try stuff like turning off the PSSM Filter, or not attaching vegetation.

It seems like this could be comming from a mix of PSSM and your 1600 Objects. Maybe try Geometry Batching your vegetation or something to cut down on the number of draw calls?

600 objects, 97k tri’s and 111k vertices

Shouldn not be a problem basically,

plz some info on your pc hardware?

pssm can use quite some power btw, I would test if it might be the reason for the slowdowns.

Also it might be an idea to check out if rendering or updateing the world is using the most of the power.

(just check the time difference from System.currentTimeinMillis at start of update to start of rendering part and from there to end of update loop. That way you might be able to find out what is causing the slowdowns.

The problem is PSSM, i’m still working on optimization.

For now object count is divided like that : classic rendered objects in the cam frustum + shadow receiver objects in the frustum + nbspits * shadow caster objects in the SCENE

add any object in the gui if you have one.

As you can see the issue is in nbspits * shadow caster objects in the SCENE, I tried to apply proper culling on the split rendering, but there seem to be a culling problem with parallel projection cam.

So with 4 splits, the object count can quickly go very high.

But yes, this is going to change, this is a bug and it eventually be fixed. Try to deactivate shadows to confirm if it’s the issue

Also I’m planning to implement Jittered edge shadows with adaptive PCF which will increase performance for a better shadow quality.

Thanks for clearing that up. It was indeed pssm that was the cause.

Looking forward to the optimizations :wink: