Which physics engine is prefered in this case?

Had a hard time getting a good video capture, but a wall/stack of 300 cubes in Jolt… dips down to ~50fps then back up to 60 pretty quicky once it settles.

That’s great!
You makes me can’t hesitate Jolt today.

And also your game looks cool!
Is this multiplayer game?

  • use Instanced Mesh for fewer draw calls
  • make floor thicker, so area mass deflects collisions
  • iteration updateCubes should decrement index dynamicBodies reference or the mesh may be inaccurate.
  • use MeshPhongMaterial
  • don’t update bodies lower than -100(?) if you prevent sleep

Thanks for your detailed suggestions! :heart:
Btw, I don’t understand some of them.

and…

Could you explain in more detail?

  • Decrement… so as the array grows you avoid the mistake of indeterminate Mesh updates. The step should be less error-prone and faster. It’s not a requirement but fundamentally may improve results. Best practice in a race condition.
  • You disabled canSleep… a way to regain some performance is to skip update of blocks that are out of bounds. Maybe you could hide them or reuse the geometry?

i dont know why it doesnt work for me,

here my code :slight_smile:

export class Template{
  constructor(){
  ...
  this.#physique();
  }

  async #physique() {
        await RAPIER.init();
        const gravity = new RAPIER.Vector3(0.0, -9.81, 0.0);
        this.worldRapier = new RAPIER.World(gravity);
        console.log(this.worldRapier)
  }
}

btw im using nuxt3 + three js native.

Thanks for your detailed explanation.
I tried to follow your tips, but can’t see any improvement…

Reduce shadows and scene resolution. Maybe you are comparing performance of fullscreen UHD with that of a letterboxed example pen? And force a limit in RAF frameloop to 60fps or 45fps!