Stats Question

What do the stats in the bottom-left corner of the application show? In particular, does the objects stat show the amount of objects attached to the rootNode or does it show the objects shown from the camera’s view?



Thanks

rtfm :stuck_out_tongue:

I don’t have a slow game :stuck_out_tongue: I just noticed that sometimes when I move the player, the object count goes up.



Is your answer in this?



… were switched in the last frame (S)
… were used during the last frame (F)
… exist in memory (M)


or this?

The Object Count (Batch Count) is a very important value that indicates how many geometries were rendered in the last frame. In general, try to keep the object count around 100-200 to keep your game fast and responsive. If the count is permanently higher, hand-code rules that detach remote objects, or optimize a complex multi-material scene using:


Either way, I didn't understand it much :/ Does the object stat keep track of the number of objects being rendered by the camera or in the whole game?

SimpleApplication displays a HUD with statistics. Use app.setDisplayStatView(true); to activate it, and false to deactivate it. It counts how many FrameBuffers, Textures, or Shaders…



… were switched in the last frame (S)

… were used during the last frame (F)

… exist in memory (M)

Example:



Textures (M) = how many textures are currently in the OpenGL driver

Textures(F) = how many textures were used in the last frame

Textures(S) = how many texture switches were done in the last frame.

Genereally jME3 is well optimized and optimizes these things correctly. The normal state is that the (S/F/M) values should be in the same order of magnitude; (S) values can be lower than (F).



If the (S) values are significantly higher than the (F) values, that means there are a lot of extra switches happening which can cause a performance loss. Switches happen for instance if you have many transparent materials in your scene. In that case this tells you that you should use fewer transparent materials.

If the (M) values are much higher than the (F) values, that means a lot more GL objects are in memory than are actually used. This can happen in rare cases, such as extremely large scenes (> 2000 wu). In this case, you should can optimize performance by identifying spatials to cull or detach.



The Object Count (Batch Count) is a very important value that indicates how many geometries were rendered in the last frame. In general, try to keep the object count around 100-200 to keep your game fast and responsive. If the count is permanently higher, hand-code rules that detach remote objects, or optimize a complex multi-material scene using:

GeometryBatchFactory.optimize(complexNode, true);

Same for Triangle Counts. If your game runs sluggishly and triangle (polygon) count is high, then you are rendering too many too detailed meshes. Tell your graphic designers to create models with lower polygon counts.

FrameBuffers: If you don’t use any post-processing effects (FilterPostProcessor), this count should be zero. The more effects you use, the more FrameBuffers are in use. If this value is high while others are normal, you can speed up the application by using fewer post-processing effects.

3 Likes

I see. Thanks normen!

Objects that are outside of the camera are not considered “rendered”, they are culled based on their bounding volume much earlier in the process.

1 Like

Thanks Momoko