Hi Dev Forum Members, I’ve been investigating performance optimization in my physics-heavy game, inspired by @MrChickenRocket’s talk on Using Roblox Tools to Improve Performance. During my analysis, I discovered an unexpected behavior related to selection boxes and draw calls.
Observation: Selection Boxes and Draw Calls
In an empty workspace, I found that each selection box contributes 12 draw calls, which seems excessive. Here’s what I observed:
A single part with a selection box uses 13 draw calls:
- 1 for the base part
- 12 for the selection box itself (1 for each “part” of the box)
This behavior appears suboptimal when compared to a custom solution:
A custom selection box using parts with Neon material requires only 2 draw calls:
- 1 for the base part
- 1 for the Neon material on the custom selection box parts
This high draw call count for selection boxes could impact performance, especially when multiple are used like in my case.
whats a draw call?
A draw call instructs the graphics API on what and how to draw, including information about textures and shaders. In Roblox, batching (using many baseparts) can reduce draw calls.
For example:
This scene with 1224 parts results in only 1 draw call, demonstrating effective batching. Generally, lower draw call counts correlate with better performance.
For more details on draw calls and optimizations, see MrChickenRocket’s dev forum post.
Selection boxes are great because they alow for quick addition of a clear point of interest
In my use case its to highlight buttons the player can step on.
Creating multiple different sized custom selection boxes for my use case is not realistic
I appreciate any insights or suggestions from the community on this matter.