No benefit from BatchNode - Am I doing anything wrong?

Hello guys,

why can I not get ANY improvement when I use BatchNode on a node of geometries that I have?

I am using the simple code below:

nTest.removeFromParent();
			testBatch.attachChild(nTest);
	
			// batch parent node
			testBatch.batch();

			// attach batchNode to rootNode
			rootNode.attachChild(testBatch);

Also noticed that the batch node will contain the old node (with its geometries) and another geom-batch geometry. Which seems okay from what I read from the API. Yet, I don’t see ANY type of improvement when using it or not.

Any ideas?

Thanks

It really depends on what types of geometries and materials you have. BatchNode just helps to reduce number of context switches/batches things in bigger chunks - but it won’t be noticeable, if batchable things were not a real bottleneck beforehand.

What kind of geometries do you have there? Can you post stats window with and without batching? What kind of frame times do you see with and without batching (ms, not fps)?

1 Like

I must be doing something wrong as it actually gets worse and the number of objects increases. It seems it is loading the batched node as well as the old one.

With batching

With Batching

Without batching

Without Batching

I just realized that my objects although most of them have the same color , they have different materials. Quoting @pspeed >>

BatchNode will batch geometries with the same material. If they don’t have the same material then they don’t get batched. If they aren’t getting batched then they don’t have the same material.

so I am assuming this is my issue.

I just realized that my objects although most of them have the same color , they have different materials. Quoting @pspeed >>

BatchNode will batch geometries with the same material. If they don’t have the same material then they don’t get batched. If they aren’t getting batched then they don’t have the same material.

so I am assuming this is my issue. Although the material is the same , they have different material instances (different instance id), does that translate to them having different materials correct?