How can I define the position of the camera when I enter into XR mode? I mean when I enter into XR mode I’m always in the 0 0 0 position ideally the user should keep (more or less because the height of the user could change etc) the original relative position to the camera isn’t it?
How the floor is defined? the same scene with the same objects sometimes it is placed on the floor correctly, others they are floating, sometimes they looks bigger other some times it looks smaller
Following this sample https://playground.babylonjs.com/#NAZYHG#5 I found that in some devices I get: “webxr-polyfill.js:4444 The required feature ‘light-estimation’ is not supported” That’s ok but how can I check that in advance so I can enable/disable it depending on the device?
Btw I’ve tried to check that as this but without luck:
When entering VR you are assigned the position of the current camera, excluding position.y which will be populated by the XR system. When entering AR, you are not bound to an entry point. Your enter point is 0,y,0 (let’s ignore Y at the moment), because every time you enter the AR scene in a different position in the real world. What do you expect will happen if you change the camera position in AR? you will not move to a different room. It is possible to change the camera’s position, of course. right after entering XR you can set the camera’s position. In AR it’s not a good practice, at least not until XR will support persistent / permanent anchors, which will allow us to define an entry point.
Certain devices and OS versions support XR in different manner. I am also not 100% sure where the polyfill is coming from, as we are not adding it automatically in the playground. Make sure the WebXR incubation flag is turned on in chrome://flags, especially if you are developing. Just know that some people won’t be able to use some features.
A small note - you can set a certain feature as optional. It is the last optional variable in the enableFeature function.
Not sure what you mean here. You mean after applying the environment? Env in XR works the same as ENV in a standard desktop playground. Do you have the same experience there?
1- OK I understand your point I’ll try to make a workaround.
2 - I tried with unbounded but things (people in my case) were floating I needed them placed on the actual ground.
3 - Great! I think that marking it as optional could do the work, btw polyfill was added by the PC Chrome emulator, it doesn’t support that feature and all my mobile devices have it so it is the only way I’ve found to check what happens if it is not supported.
4- Please test my playground https://playground.babylonjs.com/#NAZYHG#85 my two pink balls (no pun intended!) have different roughness at the beginning but as soon as you get into AR both are super shiny as if they have no roughness at all.
yeah, this is all Apple’s fault. They have decided not to implement webxr for safari, and also decided to force safari to be the only browser on iOS. Fair? no. Good for the web? No. Good for apple? I guess?..
They even gave the community a little bit of hope, adding an experimental flag to enable webxr on iOS 16, and then just removed it in a recent update.
You could use plane detection for that, and apply shadow-only material on them. This way you will case shadows on those detected planes while the planes themselves will not be visible.
sorry, didn’t get a chance to debug this yet. They do look different, but not as they do outside of AR.
Is this with the light estimation turned on? Does it happen with the light estimation turned off?