Jump to content

VRDeviceOrientationFreeCamera : PickInfo fail and Canvas2D glitchy


TheTrope
 Share

Recommended Posts

Hi !

My scene is working well with FreeCamera, but when i switch to VRDeviceOrientationFreeCamera, some issues appear:

FreeCamera: (point over babylonjs logo, the canvas2D sprite size will grow)

http://www.babylonjs-playground.com/#XQY4I#13

 

VRDeviceFreeOrientationCamera (on mobile, no need to use cardboard to see what is failing): (pickInfo totaly fail -see console- + glitchy look of canvas2D when moving || See lines 93-111)

http://www.babylonjs-playground.com/#XQY4I#14

 

In addition, I tried things to bypass pickInfo, but my own implementation of rayPicking does not work, i don't understand why (Lines 86-91)

 

Do you see a mistake in my scene?

Thank you !

Link to comment
Share on other sites

On 9/21/2016 at 5:14 PM, TheTrope said:

Hi !

My scene is working well with FreeCamera, but when i switch to VRDeviceOrientationFreeCamera, some issues appear:

FreeCamera: (point over babylonjs logo, the canvas2D sprite size will grow)

http://www.babylonjs-playground.com/#XQY4I#13

 

VRDeviceFreeOrientationCamera (on mobile, no need to use cardboard to see what is failing): (pickInfo totaly fail -see console- + glitchy look of canvas2D when moving || See lines 93-111)

http://www.babylonjs-playground.com/#XQY4I#14

 

In addition, I tried things to bypass pickInfo, but my own implementation of rayPicking does not work, i don't understand why (Lines 86-91)

 

Do you see a mistake in my scene?

Thank you !

Can you confirm that your 2nd PG (the one with VRCamera) is working as expected from a PC ? Because I do.

Now I've checked on a tablet and it's failing, my guess is the VRCamera on a PC is fallbacked to a "standard camera or whatever" because there's no accelerometer.

Concerning your own implem of rayPicking, well, this kind of routine is really hard to get working, I'm not saying your don't, but I'm saying: I can't tell if it's working or not.

Edit: on the tablet I don't have a picking failure, well, I can pick the ground1, wall but when it's on mini1 there's nothing picked but there's no error or whatsoever. Is that what you have.

Also, I don't have a glitchy look of Canvas2D when moving at all, it's looking totally ok on both PC and Tablet.

Link to comment
Share on other sites

6 hours ago, Nockawa said:

Can you confirm that your 2nd PG (the one with VRCamera) is working as expected from a PC ? Because I do.

Now I've checked on a tablet and it's failing, my guess is the VRCamera on a PC is fallbacked to a "standard camera or whatever" because there's no accelerometer.

Concerning your own implem of rayPicking, well, this kind of routine is really hard to get working, I'm not saying your don't, but I'm saying: I can't tell if it's working or not.

Edit: on the tablet I don't have a picking failure, well, I can pick the ground1, wall but when it's on mini1 there's nothing picked but there's no error or whatsoever. Is that what you have.

Also, I don't have a glitchy look of Canvas2D when moving at all, it's looking totally ok on both PC and Tablet.

Thanks for your answer !

the 2nd PG is working as expected on a PC.

When i try with my phone, i got picking results with an angle difference. If i target the mini1, i got the ground, and if i target a special position in the "sky", i can hit mini1. It feels like the angle of viewport is different than the one used to compute pickInfos.

For the glitchy look of Canvas2D, i got this when moving my phone. I can't take a screenshot because the result is "shaking/shuddering". I see a kind of double canvas, but it's because it's shaking. (If you keep moving your phone, you should see it on the second PG (#13), u will see a double red point )

 

I just tried on tablet, and yes, there is still a little shaking effect. On smartphone it's more visible

Link to comment
Share on other sites

Well, I'm not in my comfort zone here, because a WorldSpaceCanvas is just a plane mesh displaying a Texture, I don't know why the picking is not working, I mean it's not different from any other mesh... 

I have to check if the scale on the mesh is 1 or different...

About the glitchy look, I could see it more clearly on my phone too, I think there's a lag due to the rendering architecture of the VR Mode, I have to talk with other bjs core members to understand how it works and what's going on.

May I ask if this is urgent for you or not? I've several things ongoing right now so I have to set priority accordingly. Thanks!

Link to comment
Share on other sites

The picking do not work with others mesh of the scene too on Mobile, the is a huge gap between the mesh that it should pick and the ones it pick.

 

This project is my main subject of my internship, so i have a few weeks to get it work :/

But this is is certainly an issue for everybody who wan't to use Canvas2D as an UI for VR :/

 

Thanks !

Link to comment
Share on other sites

15 hours ago, TheTrope said:

The picking do not work with others mesh of the scene too on Mobile, the is a huge gap between the mesh that it should pick and the ones it pick.

 

This project is my main subject of my internship, so i have a few weeks to get it work :/

But this is is certainly an issue for everybody who wan't to use Canvas2D as an UI for VR :/

 

Thanks !

Ok, let me be clear on one point: the picking issue is not related to VR camera, but it's related to mobile, right 

Because I've tried this PG:  http://www.babylonjs-playground.com/#XQY4I#13 and it works on PC but not on mobile.

So talking about VR is maybe a second issue, but first we have to solve this one, right?

Link to comment
Share on other sites

23 hours ago, Nockawa said:

Ok, let me be clear on one point: the picking issue is not related to VR camera, but it's related to mobile, right 

Because I've tried this PG:  http://www.babylonjs-playground.com/#XQY4I#13 and it works on PC but not on mobile.

So talking about VR is maybe a second issue, but first we have to solve this one, right?

Well, as you suggested before, maybe the VR camera on PC is fallbacked to a standart camera. In this case, it could be related to the camera.

In addition, i did the pickInfo based on width and height of the screen (to get a camera target ray) so in this case, it could be a pickInfo bug

And yes, this issue is my priority :/

Thanks !

Link to comment
Share on other sites

6 minutes ago, TheTrope said:

Well, as you suggested before, maybe the VR camera on PC is fallbacked to a standart camera. In this case, it could be related to the camera.

In addition, i did the pickInfo based on width and height of the screen (to get a camera target ray) so in this case, it could be a pickInfo bug

And yes, this issue is my priority :/

Thanks !

the bug also happens with a FreeCamera on mobile for me! it doesn't pick the "mini1" mesh!

@Deltakosh can you take a look? thanks

Link to comment
Share on other sites

@Deltakosh This PG: http://www.babylonjs-playground.com/#XQY4I#13 is working fine on PC, the expected behavior is when the spinning rect is targetting the babylon.js logo then it zoom (the spinning rect). basically the code does a scene picking at the center of the screen and if the "mini1" mesh is returned then it spins.
This works on PC, but it doesn't work on mobile/tablet, for some reason the picking doesn't return the expected mesh.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...