Forum Discussion
Vrally
12 years agoProtege
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?
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
- whoisonlineExplorerHave you tried it on another computer? does it do the same?
- VrallyProtege
"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. - brantlewAdventurerIt'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). - PrelucidHonored GuestIs the object the (camera is attached to/ or the child of) scaled in some way?
- VrallyProtege
"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?
- janocExplorerHello,
"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 - VrallyProtege
"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. - janocExplorer
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. - cyberealityGrand ChampionCan you post the snippet of code that fixes this?
Make sure to use the "code" tags. Thanks. - VrallyProtege
"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().
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
- 1 year ago
- 1 month ago
- 10 months ago