Forum Discussion
MrKaktus
11 years agoExplorer
Win8.1 judder in landscape(flipped) [working WA proposed]
Hi, I've recently installed Windows 8.1 Pro as second operating system.
I'm observing that Extended Desktop mode is no working correctly ?
Somehow this issue is not picked up by anybody?
Here are just 3 threads I fould that mention this issue:
https://forums.oculus.com/viewtopic.php?f=34&t=17545
https://forums.oculus.com/viewtopic.php?f=34&t=16829
https://forums.oculus.com/viewtopic.php?f=34&t=15972
In short:
- When in Extended Desktop mode:
- Oculus Display is detected differently on Windows 8.1 and Windows 7
- In "Landscape" mode there is no Judder ( but everything is rotated by 270 degree, so it looks flipped upside-down ).
- In "Landscape (flipped)" mode display is properly rotated by 90 degree, but there is terrible judder.
My observations after reading other threads:
- Windows 8.1 has no Aero mode to disable, so it won't fix it
- Nvidia drivers are no longer supporting display rotation on GPU (since WinXP) which means desktop compositing system does it on CPU, and then it probably forces sync of all displays to common refresh rate which is 60Hz - Judder appears.
- Windows 8.1 does display rotation in reversed direction in comparison to Windows 7.
WA proposed by others that are not taken into notice:
- Decrease resolution of primary monitor and force it to 75Hz -> Not every display can be bumped to 75Hz
- Set Oculus DK as primary monitor -> I don't believe any customer will integrate into his settings so much, it's to complicated for end users, then they need to switch it forth and back, Oculus should just work for them
- Disable other displays except Oculus -> the same as above
My WA proposition for now (will need to implement it):
- Set in Extended Desktop mode Oculus to Landscape (everything is "upside-down" but we don't have judder).
- Detect in game Windows 8.1 (somehow??)
- When performing distortion rendering take into notice rotation by 270 degrees and flip everything with proper matrix
- As a result this should remove issue for now
Reproduced on:
- Windows 8.1 Pro
- Oculus DK2
- Extended Desktop mode
- NO legacy support for DK1
- Rift Saver ON
- OpenGL, NON-SDK cutom rendering (works correctly on Windows 7).
- VSync is ON.
Cannot observe the issue in OculusRoomTiny 0.4.4 (works correctly in both SDK, and Custom rendering mode).
It renders in DX11 so maybe difference in swap-chain is the answer?
OculusWorldDemo (forced to GL) is not detecting properly DisplayID for HMD which results in creating window on Monitor instead of Oculus so I cannot check judder there.
Question to dev team:
- Can you confirm judder-flip issue on Windows 8.1 and Oculus OpenGL Extended Desktop mode ?
I'm observing that Extended Desktop mode is no working correctly ?
Somehow this issue is not picked up by anybody?
Here are just 3 threads I fould that mention this issue:
https://forums.oculus.com/viewtopic.php?f=34&t=17545
https://forums.oculus.com/viewtopic.php?f=34&t=16829
https://forums.oculus.com/viewtopic.php?f=34&t=15972
In short:
- When in Extended Desktop mode:
- Oculus Display is detected differently on Windows 8.1 and Windows 7
- In "Landscape" mode there is no Judder ( but everything is rotated by 270 degree, so it looks flipped upside-down ).
- In "Landscape (flipped)" mode display is properly rotated by 90 degree, but there is terrible judder.
My observations after reading other threads:
- Windows 8.1 has no Aero mode to disable, so it won't fix it
- Nvidia drivers are no longer supporting display rotation on GPU (since WinXP) which means desktop compositing system does it on CPU, and then it probably forces sync of all displays to common refresh rate which is 60Hz - Judder appears.
- Windows 8.1 does display rotation in reversed direction in comparison to Windows 7.
WA proposed by others that are not taken into notice:
- Decrease resolution of primary monitor and force it to 75Hz -> Not every display can be bumped to 75Hz
- Set Oculus DK as primary monitor -> I don't believe any customer will integrate into his settings so much, it's to complicated for end users, then they need to switch it forth and back, Oculus should just work for them
- Disable other displays except Oculus -> the same as above
My WA proposition for now (will need to implement it):
- Set in Extended Desktop mode Oculus to Landscape (everything is "upside-down" but we don't have judder).
- Detect in game Windows 8.1 (somehow??)
- When performing distortion rendering take into notice rotation by 270 degrees and flip everything with proper matrix
- As a result this should remove issue for now
Reproduced on:
- Windows 8.1 Pro
- Oculus DK2
- Extended Desktop mode
- NO legacy support for DK1
- Rift Saver ON
- OpenGL, NON-SDK cutom rendering (works correctly on Windows 7).
- VSync is ON.
Cannot observe the issue in OculusRoomTiny 0.4.4 (works correctly in both SDK, and Custom rendering mode).
It renders in DX11 so maybe difference in swap-chain is the answer?
OculusWorldDemo (forced to GL) is not detecting properly DisplayID for HMD which results in creating window on Monitor instead of Oculus so I cannot check judder there.
Question to dev team:
- Can you confirm judder-flip issue on Windows 8.1 and Oculus OpenGL Extended Desktop mode ?
18 Replies
- MrKaktusExplorerI've done more research and it looks like WA proposed by me is not working (which is REALLY weird).
Please look at this 3 situations:
1) Oculus is in "Landscape" mode, so that everything renders rotated by 270 degrees and looks "flipped", game renders exactly the same as in Windows 7 where display is properly positioned. There is NO judder.
2) As I'm rendering using OpenGL I'm using such modification of scale and offset on Windows 7 to take into notice flipped Y axis in Framebuffer:
float2 scale = float2(settings[i].UVScaleOffset[0].x, settings[i].UVScaleOffset[0].y);
float2 offset = float2(settings[i].UVScaleOffset[1].x, settings[i].UVScaleOffset[1].y);
// OpenGL invert framebuffer Y axis
scale.y = -scale.y;
offset.y = 1.0f - offset.y;
eyeToSourceUVScale.set(scale);
eyeToSourceUVOffset.set(offset);
So it seems logic, that to fix Windows 8.1 "flipped" rendering I just need to do this:
float2 scale = float2(settings[i].UVScaleOffset[0].x, settings[i].UVScaleOffset[0].y);
float2 offset = float2(settings[i].UVScaleOffset[1].x, settings[i].UVScaleOffset[1].y);
// OpenGL in Windows 8.1 WA - Flip in both Y and X axes to emulate rotation by 270 degrees
//scale.x = -scale.x;
eyeToSourceUVScale.set(scale);
eyeToSourceUVOffset.set(offset);
3) Above code looks ok, but maybe it is not taking into notice time-warp matrices? So let's just modify final position in VS instead of scale and offset:
#version 110
attribute vec2 inPosition;
attribute vec2 inTexCoord0;
attribute vec2 inTexCoord1;
attribute vec2 inTexCoord2;
attribute float inVignette;
attribute float inTimeWarp;
varying vec4 Position;
varying float Vignette;
varying vec2 TexCoord0;
varying vec2 TexCoord1;
varying vec2 TexCoord2;
uniform vec2 EyeToSourceUVScale;
uniform vec2 EyeToSourceUVOffset;
uniform mat4 EyeRotationStart;
uniform mat4 EyeRotationEnd;
vec2 TimewarpTexCoord(vec2 TexCoord, mat4 rotMat)
{
// Vertex inputs are in TanEyeAngle space for the R,G,B channels (i.e. after chromatic
// aberration and distortion). These are now "real world" vectors in direction (x,y,1)
// relative to the eye of the HMD. Apply the 3x3 timewarp rotation to these vectors.
vec3 transformed = vec3( vec4(rotMat * vec4(TexCoord.xy, 1.0, 1.0) ).xyz);
// Project them back onto the Z=1 plane of the rendered images.
vec2 flattened = (transformed.xy / transformed.z);
// Scale them into ([0,0.5],[0,1]) or ([0.5,0],[0,1]) UV lookup space (depending on eye)
return (EyeToSourceUVScale * flattened + EyeToSourceUVOffset);
}
void main()
{
mat4 lerpedEyeRot = ((1.0 - inTimeWarp) * EyeRotationStart) +
(inTimeWarp * EyeRotationEnd);
Position = vec4(inPosition.xy, 0.5, 1.0);
Vignette = inVignette;
TexCoord0 = TimewarpTexCoord(inTexCoord0, lerpedEyeRot);
TexCoord1 = TimewarpTexCoord(inTexCoord1, lerpedEyeRot);
TexCoord2 = TimewarpTexCoord(inTexCoord2, lerpedEyeRot);
// Windows 8.1 flip fix WA
Position.x *= -1.0;
Position.y *= -1.0;
// To be compatible with GLSL 1.10
gl_Position = Position;
}
Now taking into notice original situation and 2 proposed fixes lets see what really happens:
1) From logs it looks like Oculus is in fact rendering in 60Hz ! ( propably forced to by Windows 8.1 compositing system?).
As it is set to 75Hz we see in logs that time-warp is struggling with 60Hz VSync:
Frame time = 9.04 ms sync time = 6.8310 ms
Frame time = 7.61 ms sync time = 5.5600 ms
Frame time = 16.68 ms sync time = 14.6650 ms
Frame time = 16.63 ms sync time = 14.5800 ms
Frame time = 16.68 ms sync time = 14.6500 ms
Frame time = 8.98 ms sync time = 6.9420 ms
Frame time = 7.63 ms sync time = 5.7750 ms
Frame time = 16.66 ms sync time = 14.7530 ms
Frame time = 16.66 ms sync time = 14.7670 ms
Frame time = 16.65 ms sync time = 14.7660 ms
Frame time = 16.64 ms sync time = 14.7670 ms
Frame time = 5.70 ms sync time = 3.8060 ms
Frame time = 10.98 ms sync time = 9.1970 ms
Frame time = 16.63 ms sync time = 14.7320 ms
Frame time = 16.69 ms sync time = 14.7170 ms
Frame time = 16.64 ms sync time = 14.7500 ms
Frame time = 5.62 ms sync time = 3.7520 ms
Frame time = 10.99 ms sync time = 9.1470 ms
Frame time = 16.67 ms sync time = 14.8370 ms
Frame time = 16.65 ms sync time = 14.7420 ms
Frame time = 16.64 ms sync time = 14.7310 ms
BUT THERE IS NO JUDDER ????
Q1: How it is possible?
2) Now lets look at results of runig app with WA in flipped scale :
Frame time = 2.01 ms sync time = 1.3120 ms
Frame time = 14.50 ms sync time = 13.8720 ms
Frame time = 16.63 ms sync time = 16.0240 ms
Frame time = 16.56 ms sync time = 15.9930 ms
Frame time = 16.72 ms sync time = 16.1580 ms
Frame time = 2.50 ms sync time = 1.9210 ms
Frame time = 14.18 ms sync time = 13.6320 ms
Frame time = 16.68 ms sync time = 16.1020 ms
Frame time = 16.75 ms sync time = 16.1520 ms
Frame time = 16.53 ms sync time = 15.9450 ms
Frame time = 2.40 ms sync time = 1.7920 ms
Frame time = 14.27 ms sync time = 13.7370 ms
Frame time = 16.68 ms sync time = 16.1020 ms
Frame time = 16.59 ms sync time = 15.9720 ms
Frame time = 16.61 ms sync time = 16.0190 ms
Now image renders correctly.
We are still forced to 60Hz, BUT NOW THRERE IS SIGNIFICANT JUDDER ???
How it is possible that just switching scaling x and y sign introduces judder ?
One can say that it is because Time-Warp matrices are not taken into notice then.
3) Ok, so let's just flip X and Y sign of vertices position at the end of VS:
Frame time = 3.17 ms sync time = 0.0010 ms
Frame time = 13.45 ms sync time = 0.0020 ms
Frame time = 17.00 ms sync time = 0.0060 ms
Frame time = 16.36 ms sync time = 0.0070 ms
Frame time = 16.52 ms sync time = 0.0060 ms
Frame time = 3.19 ms sync time = 0.0030 ms
Frame time = 13.65 ms sync time = 0.0040 ms
Frame time = 16.63 ms sync time = 0.0020 ms
Frame time = 16.67 ms sync time = 0.0030 ms
Frame time = 16.66 ms sync time = 0.0020 ms
Frame time = 2.98 ms sync time = 0.0020 ms
Frame time = 13.83 ms sync time = 0.0040 ms
Frame time = 16.47 ms sync time = 0.0020 ms
Frame time = 16.62 ms sync time = 0.0030 ms
Frame time = 16.66 ms sync time = 0.0020 ms
(PS: don't look at sync time here, counte was changed and is not reflecting it anymore, look at frame time)
The same result! Correct rendering, Oculus fighting with 60Hz VSync and HORRIBLE JUDDER even though I've just changed vertices final orientation on the screen.
TL;DR:
- In Extended Desktop mode Oculus looks to be rendering in 60Hz (even though set to 75Hz) but there is NO judder.
WHY ?
- How to FORCE Oculus to run in 75Hz in Windows 8.1 ? (there is no Aero to disable there )
- Why changing sign of vertex x and y values introduces Judder ?? How it is even possible ?
Oculus Dev Team, please let's solve this together. - MrKaktusExplorerAs I've mentioned earlier, I wasn't taking into notice WA's that are not acceptable from release application point of view:
WA proposed by others that are not taken into notice:
- Decrease resolution of primary monitor and force it to 75Hz -> Not every display can be bumped to 75Hz
- Set Oculus DK as primary monitor -> I don't believe any customer will integrate into his settings so much, it's to complicated for end users, then they need to switch it forth and back, Oculus should just work for them
- Disable other displays except Oculus -> the same as above
I've finally decided to try them as it looks like there is completly no interest in this issue from Oculus support team.
So here is solution that works, but it is dirty WA that is unacceptable for customer product release:
- Set Oculus in Extended Desktop mode to Landscape (everything is "upside-down" but we don't have judder).
- Now set Oculus as primary display.
- Detect in game that it is running on Windows 8.1
- When performing distortion rendering take into notice rotation by 270 degrees and flip everything with proper matrix, or even simpler, by adding this two lines in your distorion shader:
// Windows 8.1 flip fix WA
Position.x *= -1.0;
Position.y *= -1.0;
Your game will render correctly in 75Hz without judder now.
But as you can guess, now all your icons and start menu are on Oculus display, and all new opened windows will appear there as well. And as if there were not enough of bad things already, all that will be flipped upside-down.
I hope Oculus team will be willing to fix that quickly, or add proper OpenGL support to direct mode. - TikhimanHonored GuestWow. I have the exact same problem that you are describing here. I'm not a programmer and this workaround seems pretty complex but I might be willing to give it a try. Is there any way you could provide step by step instructions on how to get this working? I'm not quite clear on what you mean by getting the game to detect that it is running in 8.1 or how to access the distortion rendering and where you would paste the code to flip the image. Thanks.
- MrKaktusExplorerThis WA steps are for developers.
- Game needs to detect that it is currently running on Windows 8.1 to render flipped image only then. If it is running on Windows 7 it should render normally.
- Only game developer can modify game code or shaders to apply this WA lines.
Because of above, end users like you are unable to apply this WA. And this is why Oculus team should look into this (probably cooperate with Windows team as well if it is possible). - TikhimanHonored GuestThat's a shame. I've been trying to get my oculus working with Elite Dangerous and was really hoping for a fix. It looks great when you set it to landscape but everything is upside down. landscaped flipped makes the orientation correct but induces judder. I'm really hoping that someone comes up with a fix or workaround soon. Thanks for all your work in figuring this stuff out. Hopefully the oculus team will work on patching it to take this into account.
- cyberealityGrand Champion@Tikhiman: Have you already set your monitor to 75Hz and/or made the DK2 the primary display?
- TikhimanHonored GuestI have tried setting the oculus as the primary display. It does not change anything. There is still judder. I cant set my monitor to 75Hz as it maxes out at 60Hz.
- MrKaktusExplorerModerator, please move this thread to "General Development" as it can help developers more there (it looks like "Reporting Issues" is mostly overwhelmed with user questions).
- cyberealityGrand ChampionOK, moved.
- pixelvspixelHonored Guest
"mrkaktus" wrote:
I've done more research and it looks like WA proposed by me is not working (which is REALLY weird).
Please look at this 3 situations:
1) Oculus is in "Landscape" mode, so that everything renders rotated by 270 degrees and looks "flipped", game renders exactly the same as in Windows 7 where display is properly positioned. There is NO judder.
2) As I'm rendering using OpenGL I'm using such modification of scale and offset on Windows 7 to take into notice flipped Y axis in Framebuffer:
I really, really, wanedt to say that I believe you are definitely on to something. I've been working on a demo in UE4, the magic combination for the most part has been the 0.4.2 runtime and UE4 4.6.1, it has just worked for me. My monitor at home doesn't really like being overclocked to 75mhz so I've left it at 60 and I always run in direct mode. Anyhow, going forward Unreal is going to force you to use the latest (being 0.4.4) just to work. No matter what I do, I just can't get a smooth rotation with 4.7 (release 3) and 0.4.4 together. In extended mode or direct mode.
Anyhow, I tried what you suggested, ran in extended mode, but in landscape mode. Of course everything in the game is reversed and upside down. BUT, I've never seen performance that flawless in the Rift and Unreal.
Going to do a little digging myself, and see what options I have for getting a quick fix working for me. I'm not so worried about having users having to replicate this behavior any time soon, as I'm just looking to have this run on one or two machines.
You rock!
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
- 6 years ago
- 2 years ago
- 5 months ago
- 2 years ago