PointerDragBehavior slow on babylon-reactnative but fine on Chrome

Hello,

I am trying to add a new feature to an existing application: load objects in AR and move them using the DragPointerBehavior.
I am using babylon/react-native 1.5.1 with babylon/core 5.57.1, babylonjs/react-native-iosandroid-0-70 and react-native 0.70.7 and testing on my Android device.
As long as the loaded object is small (e.g. https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/BoxAnimated/glTF-Binary/BoxAnimated.glb) things are pretty smooth but if I use bigger objects (https://playground.babylonjs.com/scenes/skull.babylon or https://raw.githubusercontent.com/wallburners/test/main/winged_victory_of_samothrace.glb) things get really bad: as soon as I click on the object the whole camera freezes and it’s almost impossible to move the objects.
On the other hand, when I do the same with “vanilla” babylonjs in Chrome on the same device (https://playground.babylonjs.com/#XNDGIG#6) things are fine.

I built a sample app (highly inspired from BabylonJS/BabylonReactNative Playground App) to reproduce the problem. To use different meshes, press “Toggle EngineScreen” and loop through the 3 URLs mentioned above.
The source code is available at GitHub - wallburners/test and all you have to do is run npx react-native run-android.

At this stage I’m completely lost and could definitely use some help from the gurus around here.

Thanks in advance,

Antoine.

@Cedric might be able to help on this one ?

Hey @Antoine_Bonavita welcome to the forum!

Can you please try to set these properties to true on the scene:

and also, try this property:

Chrome on the browser uses JIT whereas, on reactive native, there is not jit.

Hello @Cedric,

Thanks for the help (and the great work on babylon react native). Unfortunately “it does not work”. :cry:

To be a bit more precise:

  • If I set the performancePriority to Aggressive, the “animated box” mesh does not show and the “skull” cannot be picked.
  • If I set performancePriority to Intermediate, everything shows but the objects cannot be picked.
  • If I do not set performancePriority (which should default to BackwardCompatible) but set the skipPointer*Picking to true, the objects cannot be picked.

In all those situations, I don’t have the “camera freeze” problem that I am seeing when dragging objects.

If there is anything I can do to help diagnose the problem, please let me know.

Antoine.

Did you try to set this to true ? Scene | Babylon.js Documentation