I have been playing a lot with mobile AR the last two months building some simulations and games and have noticed a bit of an issue that may be best fixed with a feature request.
Many of my projects started out in Babylon’s 3D mode, and also often fallback to 3D if AR support is not available. I also sometimes use meshes that are massive - terrains can be Kms in size , or vehicles built @ scale can be many meters tall or long. All need to remain in their original size for both use in 3D and AR, and also just for ease of the art prep pipeline.
Getting these to fit on screen as a manageable size in Babylon 3D is trivial as you can manipulate scale, camera zoom, camera perspective, ext with ease and since everything is “in screen” you don’t have to worry about real-world constraints.
But, this actually gets more tricky when in AR as all the sudden those game units (which are in meters) start taking up real-world meters or even KM of real-world space. For instance a few weeks back I had to import a 12km^2 slice of terrain . In 3D no problem seeing the whole thing in one screen by zooming out slightly. But, when I fired up AR originally I thought I broke something as I did not see it render. That is until I looked out the window of my bedroom and could see 12km of game terrain spanning out in front of me… Or today I imported a mech that at true 1unit / 1m scale is literally bigger than my house at 6 game units tall ! All I could see was its foot inside my bedroom. Everything else was out the roof! Even importing a FPS character at the standard 2m / 2 unit Babylon height makes them life size. A NPC that spawned in AR blocked my door and would not get out of my way so I could get in the hallways. Simply put, 1 game unit = 1m IRL makes things too big for most practical use in a game or sim.
The only option right now is to scale… often a TON. This leads to really small decimal numbers which are a pain to deal with. It also starts to break babylon features when you scale that much. For instance recast-detour can only build voxles down to .001 before freaking out . When I had to scale a 12km terrain down to fit a 1m game board (a reduction of 12000) I ended up with really big and borderline unusable nav mesh as each voxel is massive even at it min allowed size. PBR materials, yup those use physical rendering and are affected too. Physics packages including Havoc… yes, that’s also affected. As is… well quite a bit else I have been discovering. Even simple position.x+1 animations applied to a box when in AR means that box is jumping 1m IRL and out the roof of your house in 6-8 frames.
What may be worth discussing is adding an option in the XR experience helpers or somewhere else to under the hood to change the physical real-world representation of dimensional size of one unit in AR mode. So 1 game unit is still 1 game unit which still = 1m - keeping1m = 1 game unit is critical for fallback to 3D, and prevents breaking things relying on meters. But maybe instead of 1m IRL looking like 1m it can be remapped to visually represent 1cm or 1 mm or 1um of real-world space. Ideally this is a completely arbitrary setting to be set based on need, you could even go the opposite direction. So, its sort of like “zooming” a camera. Everything you took a photo of does not change real-world size when you zoom-out a camera, but it is smaller visually…
The importance of this or some other solution can’t be overstated for adopting AR as it opens the door wide for us to use the entirety of Babylon in games and simulations, when in many cases ‘true-to-life’ size is not quite appropriate.
I would love to hear some thoughts on this.