Forum Discussion
skooter500
11 years agoExplorer
GL.Lines only showing in one eye
Hi Guys I am adding rift support to my Unity Game AI Framework (https://github.com/skooter500/UnitySteeringBehaviours) and I am having trouble with GL.Lines. I have a class for drawing lines that u...
skooter500
11 years agoExplorer
Thanks for the reply. I am now and that has now moved the lines to the correct locations in both eyes!
But I still have a problem which I hope you can see from these screenshots. This is screen without the rift enabled:

And this is the rift enabled screenshot:

If you line up the two screens you will see that the lines in the stereo image are being occluded by the positions of the 3D objects in the non-stereo image. Also in the non-stereo version, if a line happens to penetrate a 3D object, then the 3D object is drawn on top of the line however in the stereo image, the lines are drawn on top of the 3D models.
BTW I tried adding this line:
GL.Clear(true, false, Color.black);
And rather strangely, this partially fixes the problem for the left eye. The lines are no longer getting occluded, but are still getting drawn on top of the 3D models, but it doesn't affect the right eye image.
I feel Im getting close!
if (Params.riftEnabled)
{
GameObject ovrCameraController = (GameObject)GameObject.FindGameObjectWithTag("ovrcamera");
Camera[] cameras = (Camera[])ovrCameraController.GetComponentsInChildren<Camera>();
SteeringManager.PrintVector("Cam " + i, cameras[i].transform.position);
GL.modelview = cameras[i].worldToCameraMatrix;
GL.LoadProjectionMatrix(cameras[i].projectionMatrix);
}
But I still have a problem which I hope you can see from these screenshots. This is screen without the rift enabled:

And this is the rift enabled screenshot:

If you line up the two screens you will see that the lines in the stereo image are being occluded by the positions of the 3D objects in the non-stereo image. Also in the non-stereo version, if a line happens to penetrate a 3D object, then the 3D object is drawn on top of the line however in the stereo image, the lines are drawn on top of the 3D models.
BTW I tried adding this line:
GL.Clear(true, false, Color.black);
And rather strangely, this partially fixes the problem for the left eye. The lines are no longer getting occluded, but are still getting drawn on top of the 3D models, but it doesn't affect the right eye image.
I feel Im getting close!
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 2 months ago