New PlaneRotationGizmo performance issues

Hi BJS team

Wanted to point out that the new PlaneRotationGizmo system is pretty cool (it shows the angle difference), however it does impact performance quite a bit. The drawing of the angle diff is executed per frame via Mesh.createRibbon.
The implication is that it would cause significant frame drops in lower end devices, as it did for a laptop of mine.

Indeed, after a performance profiling on a simple scene, this function happens to be the biggest source for the total ‘scripting’ time, even more than rendering.

Wouldn’t it be better to use a shader instead?


1 Like

Pinging @davegould41 who created these great features, in case he has some ideas about this.

And adding @Cedric a guizmo Guru as well :slight_smile:


Also some suggestions about the PlaneRotationGizmo code: would be really helpful to

  • expose the dragDistance as a public variable or getter
  • flag to not actually rotate the gizmo.

Developers may need know the drag distance while rotating a fixed gizmo. Another use case is rotating a node in global mode so that the underlying node rotates but the gizmo does not. I believe Unity is already doing this for global rotations/translations!

1 Like

Happy new year y’all! Anyone looked into this yet? @Cedric @sebavan :slight_smile:

Happy new year!

I can confirm the ribbon computation is pretty CPU intensive. When I lower the tesselation value it gets way faster but the edges are clearly visible. Can you use a custom shader or NME to fix that performance issue @davegould41 ?

flag to not actually rotate the gizmo.

Can you elaborate on this one? Can you just not disable the gizmo when you don’t want to rotation?

The idea is to drag the gizmo and visualize + obtain the drag distance, without actually rotating the underlying node

@davegould41 is busy so I’ll take care of it this week.

1 Like

I’m also very busythis week. I’ll do my best to do a PR beginning of next week.


And the PR is finally here !!! rotation circle shader by CedricGuillemet · Pull Request #9827 · BabylonJS/Babylon.js · GitHub


Amazing stuff! When can we test it! :slight_smile:

you’ll be able to test with the next nightly

1 Like