High Object count optimisation

Hello,

Me again :roll:, i wanted to know if there is currently a way to reduce the geometry count on a screen, like GeometryBatchFactory in Jme with node, something like ScreenBatchFactory…
i got a lot of element on my current screen, and i can’t just remove them they are needed.
As exemple when i run the project without GUI, currently there is 36 objects, when enabling the GUI it goes up to 54-60 ->to infinite.
Currently that isn’t an issue but since it will be later on, it’s nice to be prepared and know what will have to be done in the near future :slight_smile:

Thanks

@kobRoah said: Hello,

Me again :roll:, i wanted to know if there is currently a way to reduce the geometry count on a screen, like GeometryBatchFactory in Jme with node, something like ScreenBatchFactory…
i got a lot of element on my current screen, and i can’t just remove them they are needed.
As exemple when i run the project without GUI, currently there is 36 objects, when enabling the GUI it goes up to 54-60 ->to infinite.
Currently that isn’t an issue but since it will be later on, it’s nice to be prepared and know what will have to be done in the near future :slight_smile:

Thanks

There isn’t at the moment. I’ll likely be looking into this soon… in theory, using BatchNode and enabling texture atlasing should work… however some adjustments will need to be made to the Screen class to accommodate this.

EDIT: Where I see a potential fail is the use of BitmapText, but I’ll have to try and see how it works.

Do note that “high object counts” in the guiNode are not as bad as high object counts in the scene. Obviously, more objects means more work but unless they all have controls, etc. it’s not nearly as bad as the same number of objects in the 3D scene.

Might still be worth worrying about but maybe not.

1 Like

@tonegod thanks i got an idea on what i’ll be faced on so if i run into a problem later on. Good to know that’s planned too.
@pspeed thanks for the hint, since i only worrying and not trying to resolve that in advance i’ll see later on :slight_smile:

@pspeed said: Do note that "high object counts" in the guiNode are not as bad as high object counts in the scene. Obviously, more objects means more work but unless they all have controls, etc. it's not nearly as bad as the same number of objects in the 3D scene.

Might still be worth worrying about but maybe not.

Oh… hey! Thanks for this info. I was very careful to ensure that no ui component is an actual control aside from button (which only becomes a control if setInterval is called with a value other than 0 - which enabled buttonStillDown actions, 0 disables this and removes the control)

Eventually, I would still like to try and get batching working, though, I at a slight loss for how this will work when BitmapText is nested within the components. I guess the atlases could be combined and the ui style definitions could be altered when batching takes place.

Any thoughts on handling this properly?

@t0neg0d said: Oh... hey! Thanks for this info. I was very careful to ensure that no ui component is an actual control aside from button (which only becomes a control *if* setInterval is called with a value other than 0 - which enabled buttonStillDown actions, 0 disables this and removes the control)

Eventually, I would still like to try and get batching working, though, I at a slight loss for how this will work when BitmapText is nested within the components. I guess the atlases could be combined and the ui style definitions could be altered when batching takes place.

Any thoughts on handling this properly?

In theory, there shouldn’t be an issue with batching bitmap text. It’s just a mesh and a texture. As long as you are batching per font then I think it’s probably pretty straight forward. Trying to combine fonts… that would be… more complex.

@pspeed said: In theory, there shouldn't be an issue with batching bitmap text. It's just a mesh and a texture. As long as you are batching per font then I think it's probably pretty straight forward. Trying to combine fonts... that would be... more complex.

I haven’t look at BatchNode specifically to see how this is handled, but when batching a nested geometry, does the outputted batched mesh use the world transform to keep the placement the same? I know… silly question as it wouldn’t work properly if it didn’t.

I guess the scenario I’m wondering about would be:

Node contains a geometry & a nested bitmap text geometry
When batched, geom1 would go to one batched geometry, the bitmap text would go to another. (2 different textures)

When you update the location of the original parent node (say z-order) would the batched bitmap text geometry also update to the proper location?

If the text geometry is child of the parent node, it should update with the parent node, so far, with all i know, this is how jme handle geometry, batching, parenting

1 Like