OpenVR Available, Convert?

OK @rickard, we have a big situation here. Perhaps it was just my misunderstanding, but we are completely misusing the compositor.

The compositor is suppose to be doing distortion for us. We are to submit our rendered frames to it, and then it takes care of distortion, and perhaps even handling Direct mode. This is why I’ve been seeing blank white on the Rift in some situations: because we are initializing the compositor, but not sending anything to it. Therefore, it just renders empty white to the Rift.

I tested this by NOT enabling the compositor, and sure enough, I saw the distorted image on the Rift. The distortion mesh isn’t that great, actually. You can see the black corners very easily. However, you can tell the compositor is doing a much better job with distortion because it has nicely rounded whiteness.

I think the distortion mesh will be used in situations where the compositor doesn’t work, perhaps on Linux & Mac OSX. So, it is great we got it working. BUT, we need to NOT setup the distortion mesh & instead submit frames to the compositor if it was initialized.

Here are the all-important lines in the helloworld VR app:

I did test the orientation, and the up/down inversion is fixed.