# Batch group condition

**URL:** <https://forum.playcanvas.com/t/batch-group-condition/36681>\
**Category:** Help & Support\
**Tags:** shaders\
**Created:** [August 9, 2024, 5:38am UTC](https://forum.playcanvas.com/t/batch-group-condition/36681 "2024-08-09T05:38:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sooyong\_Kim](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/sooyong_kim/32/28046_2.png) [@sooyong\_Kim](https://forum.playcanvas.com/u/sooyong_Kim)\
**Post date:** [August 9, 2024, 5:38am UTC](https://forum.playcanvas.com/t/batch-group-condition/36681/1 "2024-08-09T05:38:06Z")

</div>

Accoding to the documentation about “Batching”, there are ruls for it.

- Have the same Batch Group ID
- Have the same material
- Have the same shader parameters
- Be within a bounding box with no side larger than the Max AABB Size
- Be in the same layer
- Each batch has a maximum vertex count of 65535
- For dynamic batches there is a maximum number of movable mesh instances. This hardware dependent but has a maximum of 1024.

Among those condition, there are two conditions I want to know in detail.

“Have the same shader parameters”  
What does it mean?

Is it related to the runtime lightmap? or there is something else ?  
Does mesh shape matter?  
What if a mirrored mesh(entity)? can a mirrored (entity) be a member of a batch group?

What does it mean by “no side larger than the Max AABB”  
How can I check if a participant of a batch group exceed the border of max aabb?

---

<div class="post-metadata">

**Author:** ![mvaligursky](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/mvaligursky/32/11681_2.png) [@mvaligursky](https://forum.playcanvas.com/u/mvaligursky)\
**Post date:** [August 19, 2024, 10:37am UTC](https://forum.playcanvas.com/t/batch-group-condition/36681/2 "2024-08-19T10:37:35Z")

</div>

Check this code to see what it does:

> <https://github.com/playcanvas/engine/blob/c7294d856d951774cd0fce630e51495daaf076a0/src/scene/batching/batch-manager.js#L488-L547>

You could put breakpoints there perhaps to see what is going on.
