Hi, I'm back to ZGE and this time I'm trying to make something out of the Google cardboard VR that takes dust on my shelter...
So I made a quick example, using an old example to set viewport, and the red globule from about.zge

I read the article and I think I'll try to go with the second method (mesh based solution), since I'm doing that for Omeganaut, which has low poly. Direct vertex displacement seems to need a lot of vertex, and since I'm doing that for the low poly Omeganaut...

But before starting with that, I'd like to understand why App.ScreenWidth isn't working on Android when we start playing with the RenderPasses.
Also, I'm using 3 passes to render a single separative line over the two screen. Is that how I should do that?

We can see the cushion deformation at the very bottom of the ground lines, but since the camera is not following the headset orientation, it does not bother me. I'm going to push that to Omeganaut today and see if I puke

Edit: I just discovered that my demo is only working for Android and preview mode in ZGE. Fullscreen mode on PC is broken...

Last edited by Ats on Thu Apr 25, 2019 1:28 am, edited 1 time in total.

Now I have a little problem: when I divide the screen into two parts, it shrinks the width of the screen per two. So the image looks slim on the X axis. How can I manage that? Does that have to do with the App.CustomViewportRatio ?

Now I have a little problem: when I divide the screen into two parts, it shrinks the width of the screen per two. So the image looks slim on the X axis. How can I manage that? Does that have to do with the App.CustomViewportRatio?

Correct, you need to use a custom viewport ratio set to the ratio of the viewports you're using for each eye. Here's a simple example ..

Hi Kjell, I had some free time today to go back to VR and I'm having trouble with your example when I try to switch from one to two cameras. Here's the modified example to show the problem. This is working perfectly in the preview mode, but not with build and run... Just press space several times, you'll see:

Seems like there's a bug when switching between certain ViewportRatio modes in standalone executables. The easiest way to go around this is to simply use a CustomViewportRatio for both VR and non-VR. Here's your example with a couple of small modifications ..

Hahaha
I have another problem regarding the mouse position when the App.CustomViewportRatio is changed...
What I'm trying to do is to get the X mouse coordinates from -1 to 1 on the left screen, and same on the right screen using:

Ville informed me that the AspectRatio properties aren't meant to be updated in real-time / mid-frame, so it's better to not touch any of those values and to just modify the projection matrix instead ( might sound intimidating .. but it's super easy ). Here's a quick & dirty example.