Optimizing Physics Colliders in Complex Game Scenes

Our video game development company runs independent projects, jointly creates games with the client and provides additional operational services. Expertise of our team allows us to cover all gaming platforms and develop an amazing product that matches the customer’s vision and players preferences.

From immersive apps to game worlds and 3D scenes

Our dedicated team for VR/AR/MR development, Unity production and 3D modeling & animation — with its own case studies and capability decks.

Visit the dedicated studio
Showing 1 of 1All 242 services
Optimizing Physics Colliders in Complex Game Scenes
Medium
~3-5 days
Frequently Asked Questions

Our competencies

What are the stages of Game Development?

Latest works

  • image_games_mortal_motors_495_0.webp
    Game development for Mortal Motors
    1388
  • image_games_a_turnbased_strategy_game_set_in_a_fantasy_setting_with_fire_and_sword_603_0.webp
    A turn-based strategy game set in a fantasy setting, With Fire and Sword
    926
  • image_games_second_team_604_0.webp
    Game development for the company Second term
    544
  • image_games_phoenix_ii_606_0.webp
    3D animation - teaser for the game Phoenix 2.
    591

Optimizing Physics Colliders in Complex Game Scenes

A scene with 800 GameObjects, each with a MeshCollider based on real geometry — PhysX spends 8–12 ms per FixedUpdate on Broadphase and Narrowphase checks. That's half the frame budget for physics alone. In VR, where the frame budget is 11 ms (90 FPS), this causes an instant drop. Our team has encountered such projects many times: collider optimization is a task where proper architecture from the start saves weeks of work. Typical savings on a project range from 40 to 60 hours of manual labor. We guarantee stable 90 FPS after improvements. Contact us — we will assess your project and propose an optimization plan.

How PhysX Spends Time and Where the Losses Are

Physics in Unity goes through two stages: Broadphase (quick elimination: which objects are even close to each other?) and Narrowphase (exact intersection check for filtered pairs).

Broadphase uses an AABB tree (Axis-Aligned Bounding Box). If objects are constantly moving, the tree is constantly rebuilt. 200 Rigidbodies with isKinematic = false that move every frame cause a continuous AABB tree rebuild. Solution: objects that are not moving at the moment should be set to isKinematic = true via script — they drop out of the dynamic tree.

Narrowphase is where MeshCollider kills performance. Checking intersection of two arbitrary meshes is O(n×m) per triangles. A player collider against a building collider with 50,000 triangles means thousands of operations per Narrowphase. PhysX does not support non-convex MeshCollider against MeshCollider for dynamic objects at all — only against static.

Why Is MeshCollider So Expensive?

Every triangle in a MeshCollider requires a Narrowphase check. For static objects (walls, floors) this is tolerable, but for dynamic objects it's a disaster. Even with convex = true, physics evaluates all faces of the convex hull. Practice: replacing 10 complex MeshColliders on characters with Compound Collider reduced Physics CPU time by 40% in one VR simulator.

How Compound Collider Reduces Load

Compound Collider — a set of primitives as children of one Rigidbody. The only way to get non-convex dynamic physics without using a non-convex MeshCollider: several convex pieces = complex shape. For VR weapons, detailed objects, robots — standard approach. Replacing one MeshCollider with a Compound of 3–5 primitives reduces physics cost by 50 times while maintaining >90% accuracy.

Practical Replacements and Simplifications

First rule: replace MeshCollider where the player won't notice. A chair with MeshCollider based on real geometry is 200 triangles. The same chair with 2 BoxColliders (legs + seat) is 2 primitives. Collision accuracy is 95% of the original, cost — 50 times lower.

For organic shapes (rocks, barrels, cars), a set of 3–6 ConvexMeshColliders (convex simplified meshes) works many times faster than non-convex and is visually indistinguishable. In Unity: MeshCollider.convex = true + simplified mesh via LOD or manual collision proxy creation in Blender.

Collision Matrix (Layer Collision Matrix). In Physics Settings → Layer Collision Matrix, disable checks between layers that should never interact: Environment vs Environment, UI vs Physics Objects, VFX vs any layer. Each disabled pair means fewer Broadphase pairs. With proper matrix configuration, the number of active pairs can be reduced by 30–50%.

Sleep Threshold. Rigidbody falls asleep when velocity drops below Physics.sleepThreshold. A sleeping Rigidbody does not participate in physics — almost zero cost. The default value (0.005) is too low for complex scenes: objects remain active during micro-vibrations. For VR scenes without fluid/cloth simulation, set it to 0.1–0.2.

How We Perform Optimization: Case Study

From practice: in a VR simulator for industrial equipment, a workshop scene contained 1200 objects, most with MeshCollider from imported CAD models (15,000–80,000 triangles each). Physics CPU time — 14 ms. After replacing all static MeshColliders with convex proxies (automatically via Editor script + VHACD decomposition) and disabling unnecessary Layer Matrix pairs — Physics CPU time dropped to 2.8 ms. Gain — 80% of physics time. Average savings per project range from 40 to 60 hours of development. Cloud computing cost reduction due to less physics reaches 30–50%.

Collider Type Approximate Cost (CPU time) When to Use
MeshCollider (non-convex) ~10–20 ms for 500 tris Static, if accuracy is critical
Compound Collider (5 primitives) ~0.2 ms Dynamic, complex shapes
Convex MeshCollider (simplified) ~1–2 ms Organic objects, not requiring full accuracy

Diagnostic Tools

Physics Profiler in Unity Profiler — shows time for Broadphase, Narrowphase, SimulateAndCollide, UpdateTriggers separately. Here you can see where the losses are.

Physics Debugger (Window → Analysis → Physics Debugger) — visualizes colliders directly in Scene View with color coding by type (Static, Dynamic, Kinematic, Trigger). Allows quickly finding objects with unexpectedly heavy colliders.

PhysicsViewer custom Editor Tool — a script that outputs a list of all MeshColliders in the scene, sorted by triangle count. We write it in 30 minutes, saving hours of searching.

Typical Mistakes in Collider Optimization - Replacing all MeshColliders without regard to accuracy — can break gameplay. Check collisions on critical objects. - Setting Layer Matrix "by eye" without analyzing pairs. Always profile before/after. - Ignoring Sleep Threshold: objects that should sleep remain active due to low threshold.

What Is Included in the Work

  • Profiling Physics CPU time, identifying bottlenecks
  • Full inventory of scene colliders with classification
  • Replacing heavy MeshColliders with primitives/Compound while maintaining accuracy
  • Configuring Layer Collision Matrix and Sleep Threshold
  • Writing Editor scripts for batch replacement and validation automation
  • Re-profiling and a report with performance delta
  • Providing documentation and training the team to maintain optimization

Work Stages

  1. Profiling — Physics Profiler snapshot, identifying bottlenecks.
  2. Scene audit — inventory of all colliders, classification by type and cost.
  3. Optimization — replacing MeshColliders with primitives/Compound, tuning Layer Matrix, Sleep Threshold.
  4. Automation tools — Editor scripts for batch replacement and validation.
  5. Re-profiling — comparison with baseline, documentation of changes.
Scene Scale Estimated Timeline
1 scene up to 500 objects 3–7 days
Multiple scenes, 1000–3000 objects 2–4 weeks
Large project with automated tools 1–2 months

The cost is calculated after profiling and assessing the scope of changes. Contact us — we will assess your project for free and propose an optimization plan. Order profiling today: our team guarantees stable 90 FPS after improvements.