A glb model is showed with afterimage on Oculus Quest2

Hi @julien-moreau

I finally could converted PLATEAU models, which is city model data in Japan from MLIT government, and successfully imported them into Babylon.js Editor.

FYI: Some glb model is not showed appropriately - Questions - Babylon.js (babylonjs.com)

But when playing in Oculus Quest2, afterimage is showed like the movie.

Here is an actual glb mesh.

PLATEAU_BJSEditor_TEST/projects/scene/assets/meshes at main · flushpot1125/PLATEAU_BJSEditor_TEST (github.com)

Here is a main script file.

PLATEAU_BJSEditor_TEST/WebXRConfiguration.ts at main · flushpot1125/PLATEAU_BJSEditor_TEST (github.com)

I guess my script “WebXRConfiguration.ts” causes the issue but I can not find how to solve it.

Sorry to bothering you, but any help would be helpful for me.

1 Like

@RaananW will have a look after his vacation if @syntheticmagus can not have a look this week. In the meantime @Limes2018 could you provide a repro in the Playground ? This is impossible for us to troubleshoot and clone large projects :frowning:

1 Like

I had once this kind of artefact when using a Color3 instead of a Color4 for the scene clearColor.

1 Like

On tablet, short answer. Get rid of camera position.set(). That does not look good. If anything, change to camera.position = new BABYLON.Vector3(…)

1 Like

@Vinc3r and @JCPalmer raised as usual great points here :slight_smile: Thanks a lot

@sebavan , @Vinc3r , and @JCPalmer
Thanks a lot for kind reply. I’ll check camera.position.set() and color soon.

1 Like

If camera.position.set() is bad practice or doesn’t work at all, is there a way to make that clear from the documentation? I think it’s reasonable for a user to assume that would set the position of the camera, so maybe we need to warn against doing that.

1 Like

I removed “camera.position.set()” and tried to access on Oculus Quest2. But my browser on Quest2 denied to access my self https-server. (My quest2 may be updated…)

I’ll confirm it by uploading my code to another https server like github.io. Sorry for waiting several days.

1 Like

From a desktop today, I can elaborate. The whole point of XR is the headset IS the camera. Setting the position on entry is just going to get overridden. The headset determines the position & rotationQuaterion every frame.

You assign the position of the non-VR camera before you enter, then you can transfer it on entry.
There is an entire section in the documentation describing this:

3 Likes

Thank you for the clarification! That makes sense.

1 Like

I confirmed my modification code then afterimage had disappeared.

The modification solve the issue. Especially thanks for @JCPalmer !

 //xr.baseExperience.camera.position.set(-3.8, 2, 11);
3 Likes