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...
MrKaktus
11 years agoExplorer
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:
So it seems logic, that to fix Windows 8.1 "flipped" rendering I just need to do this:
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:
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:
BUT THERE IS NO JUDDER ????
Q1: How it is possible?
2) Now lets look at results of runig app with WA in flipped scale :
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:
(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.
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.
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
- 2 years ago
- 3 years ago