vorpX projection matrix on HTC Vive

Homepage Forums Technical Support vorpX projection matrix on HTC Vive

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #192710
    StakFallT
    Participant

    Is there a way to adjust the projection matrix (At least I believe it’s the projection matrix) for vorpX itself? I’m running into issues with most games being displayed vertically off-center.

    So if, my visual understanding of vorpX is correct, the game is rendered to a render texture, and a square (two triangles) is used for displaying that texture. Then the image is drawn twice with slightly offset matrices to simulate the separation of the eyes and provide the depth-effect — or something of that nature (maybe the game is rendered twice and then the square is rendered twice *shrug*). In any case, the problem I’m experiencing is it seems like this “square” is always off, no matter what game I use vorpX with.

    I’ve tried various settings too. Adjusting Image Zoom seems to allow me to see the game’s screen, but I think that’s only compensating for the real issue because I’ve noticed there’s like empty space below the square that the game is rendered onto. This has the effect of cutting off the top of the game (the square that the game is rendered to) and making the bottom higher than the bottom of my view by a bit. And I don’t mean like the texture is cut off and when its rendered to the square it appears cut off, I mean the square itself appears to be cut off and sitting higher than the bottom of my Vive’s LCDs.

    I’ve even tried the various aspect ratio settings, but they don’t seem to match the ratio correctly (either they fit vertically but not horizontally, or not at all, etc.). I feel like more settings for adjusting the object’s height / width and offset (both x AND y and both positive AND negative) would be huge, if settings like that don’t already exist. Anyone experience this and found a fix?

    #192713
    Ralf
    Keymaster

    That is intentional and the correct way to handle it for vorpX. Unlike native apps vorpX’s rendering is done in two steps: in the first step the game gets rendered, in the second step the final image is rendered to the headset by vorpX.

    The effect you noticed exists because in contrast to normal monitor games all VR headsets (to varying degrees) have a slightly asymmetrical view frustum, i.e. they render more below the camera than above. Headset vendors do that to gain a few precious pixels where it counts since the human brain tends to concentrate on the ground.

    Now when vorpX in its second render step aligns the symmetrically rendered game image to the asymmetrical headset frustum, the effect you noticed arises. Just centering the game image on the headset screen instead causes distortion in FullVR mode when you rotate your head due to vertically misaligned viewpoints between the game image and the second render step. In other words: what you want to match between step 1 and step 2 are the camera centers, not the image/screen centers. Both are not the same since the game’s view frustum (first step) is vertically symmetrical while the headset frustum (second step) isn’t.

    #192722
    StakFallT
    Participant

    Then by the sounds of it, if my understanding is correct. There’s not really any way to “fix” this since the issue occurs due to a mis-match between the two camera matrices (one that is used in the matrix transformation operation of the game, and one in vorpX’s matrix transformation operation)? Which isn’t really a problem, except that because the headset (I guess on a hardware level?) forces the rendering to be the way it is (what you referred to as trying to squeeze out a few more pixels, “fixing” the issue would create distortion? Wait. So does that mean game developers manually factor in that headsets put their game somewhat into a blender and adjust their matrices prior to pushing to to the HMD so that when the HMD display it with its own rendering, it looks correct?

    #192724
    Ralf
    Keymaster

    You already mentioned the “fix” yourself in your original post, although I wouldn’t call it that way since nothing is wrong. When you max out the ImageZoom setting you can fill the entire screen, the correct vertical alignment in that case is ensured by some pixels of the original image being cut off at the upper edge.

    BTW: The ImageZoom setting at 1.0 means that your vertical FOV is the same as Oculus uses for their headsets. They nailed the compromise between pixel density and FOV quite well, so my personal recommendation would be to leave it that way.

    #192727
    StakFallT
    Participant

    I agree, I’m applying the word “fix” to something that isn’t broken but because I’m not sure what else to call it… Maybe a workaround? A readjustment? A recompensation?

    Image zoom only works on the “texture” of the game that is presented to the headset though right? I ask this because the empty space I’m referring to, if I put the view mode into immersive, I see the colors of the background of immersive mode, below the in-headset screen — unless I’m remembering incorrectly. Which tells me using image zoom isn’t the correct “fix”. Kind’ve like if you held your hand (and let’s say it’s completely non-textured — we’ll say the hand is pure-white to avoid adding the un-necessary complexity of lighting into the example) in front of your face like 6 inches away, and I adjust image-zoom to make the texture of a hand fit (map correctly) on my hand, I can zoom the image out so that it fits. However, I still see all the background (that is out-of-band from the hand itself) stuff below my hand. So image zoom doesn’t make the correct adjustment. I can make it smaller so I can see all of the hand’s texture on the hand itself, but not without making everything else that was correct scale also smaller. So image zoom isn’t really even a “fix” I would say.

    #192728
    Ralf
    Keymaster

    Maxing our the ImageZoom perfectly addresses your “issue”. Apologies for trying to explain the underlying mechanics, which obviously did nothing but confuse you. Just max out the ImageZoom if you can’t live with 40 pixels or so of your screen not being utilized. All is well when you do that.

    #192730
    StakFallT
    Participant

    Yeah but then it’s too wide

    #192731
    StakFallT
    Participant

    I can’t get it to reach the bottom without making it go off the sides of the screen. Hence why I started to play with aspect ratios and doing the same there

    #192732
    Ralf
    Keymaster

    If you want to address your “issue”, maximizing the ImageZoom setting is what you want to do. I can’t really do more than trying to explain in detail to you how it works and why it works that way. For games where vorpX can adjust the FOV, it will do so automatically when you change the ImageZoom. For games where vorpX can’t adjust the FOV, you have to raise it yourself accordingly though.

    My impression however is that you might be better off leaving everything at default TBH.

    #192733
    StakFallT
    Participant

    Ok, I’ll give it a shot soon as I get a chance (and report back if it still has issues). Thanks

    #192740
    StakFallT
    Participant

    Just tried it. Yeah… no that definitely didn’t help. It brought the square that the game is rendered onto “closer” to voprX’s camera (removing vorpX’s environment from showing around the bottom), but with image zoom at 0% the square (that the game is rendered to) is already chopped off a little on the sides, so you can imagine what bringing the zooming up so that it reaches to bottom does. My next attempt is to switch the Vive headset out of direct mode, set it to extended mode and maybe try creating a custom resolution.

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.

Spread the word. Share this post!