Skip to main content
Up and Coming
August 20, 2013

Image is shearing when rolling

I have a problem with the image shearing when rolling the oculus (tilting the head to the side).

See the attached images. The first image looks ok but have no roll. The second image is rolled roughly 45 degrees. The horizon is correctly rolled BUT the building also gets quite noticeable shearing when looking through the rift:



If I disable the shader and look at the result on a monitor cloning the rift display I cannot detect any shearing/skewing.

Similar problems are described in this thread, although his problems seems to be resolution dependant:
viewtopic.php?f=34&t=3708

I have tried both 1600x1000 and 1280x800 without any improvements. Does anyone have some idea what is going on?

    10 replies

    Up and Coming
    August 20, 2013
    Have you tried it on another computer? does it do the same?
    Our Website: http://www.virtualreality.com.au Our Youtube Channel : http://www.youtube.com/user/virtualrealityau
    VrallyAuthor
    Up and Coming
    August 20, 2013
    "whoisonline" wrote:
    Have you tried it on another computer? does it do the same?


    The problem is confirmed by other developers using the same codebase.
    Participant
    August 20, 2013
    It's hard for me to see the shearing - or at least separate shearing from radial distortion in that image.

    Are you sure it's not a perceptual trick? Sometimes neck modeling (or lack of) can create perceptual shearing. Vertical lines can sometimes appear to behave differently whether you center your head rotation around your eye/nose or whether you center the rotation at the bottom of your chin (flopping your head onto your shoulder).
    Up and Coming
    August 20, 2013
    Is the object the (camera is attached to/ or the child of) scaled in some way?
    Viktor: Yes, he was wrong. But just as some things can be right and useless at the same time, can't something be wrong... and priceless?
    VrallyAuthor
    Up and Coming
    August 21, 2013
    "brantlew" wrote:
    It's hard for me to see the shearing - or at least separate shearing from radial distortion in that image.

    Are you sure it's not a perceptual trick? Sometimes neck modeling (or lack of) can create perceptual shearing. Vertical lines can sometimes appear to behave differently whether you center your head rotation around your eye/nose or whether you center the rotation at the bottom of your chin (flopping your head onto your shoulder).


    This is possible the reason for the perceived shearing. I see a hint of the same type of shearing in the Tuscany demo. But with these high rise buildings the effect gets very obvious.

    But what you are saying is that if we rolled around the neck instead of rotating around the Oculus Rift unit (as in the image below), we would alleviate some or all of the perceived shearing?
    New Participant
    August 21, 2013
    Hello,

    "brantlew" wrote:
    It's hard for me to see the shearing - or at least separate shearing from radial distortion in that image.

    Are you sure it's not a perceptual trick? Sometimes neck modeling (or lack of) can create perceptual shearing. Vertical lines can sometimes appear to behave differently whether you center your head rotation around your eye/nose or whether you center the rotation at the bottom of your chin (flopping your head onto your shoulder).


    The image is a bit unfortunate, in vivo it is much more obvious, especially in stereo. What happens is that as your roll your head, the building shears (rectangle becomes a parallelogram).

    It cannot be an issue of the center of rotation, because that would only affect the view matrix. I haven't seen anyone bothering about modelling the neck offset and pivoting the image there when using HMDs, rolling your head "around the nose" is not normally disturbing and it doesn't cause shearing neither. Having accurate yaw and pitch is a lot more important.

    Here we have the projection matrix that is incorrect. My suspicion is that there is some sort of an issue with the aspect ratio not being handled right, but I cannot spot the difference between what we are doing and what is in the official SDK code.

    Jan
    VrallyAuthor
    Up and Coming
    August 21, 2013
    "janoc" wrote:
    Hello,

    Here we have the projection matrix that is incorrect. My suspicion is that there is some sort of an issue with the aspect ratio not being handled right, but I cannot spot the difference between what we are doing and what is in the official SDK code.

    Jan


    Hi Jan,

    Your suspicion was totally correct. The scaling in the shader was not scaled correctly with respect to aspect ratio. I have now fixed this and also added the same type of distortion correction calculation that Oculus team are using in their examples. The GitHub repository is updated with the latest changes.

    I will probably add a simple (and optional) neck model later.

    Thanks all for your suggestions. I think we can mark this thread as solved now.
    New Participant
    August 22, 2013

    Hi Jan,

    Your suspicion was totally correct. The scaling in the shader was not scaled correctly with respect to aspect ratio. I have now fixed this and also added the same type of distortion correction calculation that Oculus team are using in their examples. The GitHub repository is updated with the latest changes.

    I will probably add a simple (and optional) neck model later.

    Thanks all for your suggestions. I think we can mark this thread as solved now.


    Ah, cool, that's good news! I will test it later tonight then.

    J.
    Inspiring
    August 23, 2013
    Can you post the snippet of code that fixes this?

    Make sure to use the "code" tags. Thanks.
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    VrallyAuthor
    Up and Coming
    August 24, 2013
    "cybereality" wrote:
    Can you post the snippet of code that fixes this?

    Make sure to use the "code" tags. Thanks.


    We are trying to integrate the Oculus Rift with the OpenSceneGraph rendering engine (see GitHub URL in my signature).

    The bug in our code was that the scale value that was piped into the fragment shader wasn't scaled correctly with the aspect ratio. I had omitted to multiply with the aspect ratio here. So it was a quite simple error (made by me).

    Regarding the distortion scale value, I just made a simplified version of the calculation of what is already happening in the SDK function StereoConfig::updateDistortionOffsetAndScale().