diff options
author | Brad Davis <[email protected]> | 2014-09-04 14:32:18 -0700 |
---|---|---|
committer | Brad Davis <[email protected]> | 2014-09-04 14:32:18 -0700 |
commit | 32dc394487af8e4fb1b43fb852f1d5448eaf7f31 (patch) | |
tree | be53f49e96e8e2bba1dada04197cf508b60b4eaf /LibOVR/Src/CAPI/D3D1X | |
parent | 85d370840fa4d49a63331a203460fe763288d417 (diff) |
Updating to windows 0.4.2
Diffstat (limited to 'LibOVR/Src/CAPI/D3D1X')
-rw-r--r-- | LibOVR/Src/CAPI/D3D1X/CAPI_D3D1X_DistortionRenderer.cpp | 31 | ||||
-rw-r--r-- | LibOVR/Src/CAPI/D3D1X/CAPI_D3D9_DistortionRenderer.cpp | 3 | ||||
-rw-r--r-- | LibOVR/Src/CAPI/D3D1X/CAPI_D3D9_DistortionRenderer.h | 2 |
3 files changed, 22 insertions, 14 deletions
diff --git a/LibOVR/Src/CAPI/D3D1X/CAPI_D3D1X_DistortionRenderer.cpp b/LibOVR/Src/CAPI/D3D1X/CAPI_D3D1X_DistortionRenderer.cpp index 18ad298..b2f8547 100644 --- a/LibOVR/Src/CAPI/D3D1X/CAPI_D3D1X_DistortionRenderer.cpp +++ b/LibOVR/Src/CAPI/D3D1X/CAPI_D3D1X_DistortionRenderer.cpp @@ -340,6 +340,12 @@ void DistortionRenderer::EndFrame(bool swapBuffers) if (RParams.pSwapChain) { UINT swapInterval = (RState.EnabledHmdCaps & ovrHmdCap_NoVSync) ? 0 : 1; +#ifndef NO_SCREEN_TEAR_HEALING + if (TimeManager.ScreenTearingReaction()) + { + swapInterval = 0; + } +#endif // NO_SCREEN_TEAR_HEALING RParams.pSwapChain->Present(swapInterval, 0); // Force GPU to flush the scene, resulting in the lowest possible latency. @@ -491,26 +497,33 @@ void DistortionRenderer::renderDistortion(Texture* leftEyeTexture, Texture* righ for(int eyeNum = 0; eyeNum < 2; eyeNum++) - { + { ShaderFill distortionShaderFill(DistortionShader); distortionShaderFill.SetTexture(0, eyeNum == 0 ? leftEyeTexture : rightEyeTexture); + if(RState.DistortionCaps & ovrDistortionCap_HqDistortion) + { + static float aaDerivMult = 0.5f; + DistortionShader->SetUniform1f("AaDerivativeMult", aaDerivMult); + } + else + { + // 0.0 disables high quality anti-aliasing + DistortionShader->SetUniform1f("AaDerivativeMultOffset", -1.0f); + } + if(overdriveActive) { distortionShaderFill.SetTexture(1, pOverdriveTextures[LastUsedOverdriveTextureIndex]); - - float invRtWidth = 1.0f / (float)RParams.RTSize.w; - float invRtHeight = 1.0f / (float)RParams.RTSize.h; - DistortionShader->SetUniform2f("OverdriveInvRTSize", invRtWidth, invRtHeight); - + static float overdriveScaleRegularRise = 0.1f; - static float overdriveScaleRegularFall = 0.05f; // falling issues are hardly visible + static float overdriveScaleRegularFall = 0.05f; // falling issues are hardly visible DistortionShader->SetUniform2f("OverdriveScales", overdriveScaleRegularRise, overdriveScaleRegularFall); } else { // -1.0f disables PLO - DistortionShader->SetUniform2f("OverdriveInvRTSize", -1.0f, -1.0f); + DistortionShader->SetUniform2f("OverdriveScales", -1.0f, -1.0f); } distortionShaderFill.SetInputLayout(DistortionVertexIL); @@ -524,7 +537,7 @@ void DistortionRenderer::renderDistortion(Texture* leftEyeTexture, Texture* righ ovrHmd_GetEyeTimewarpMatrices(HMD, (ovrEyeType)eyeNum, RState.EyeRenderPoses[eyeNum], timeWarpMatrices); - // Feed identity like matrices in until we get proper timewarp calculation going on + // Can feed identity like matrices incase of concern over timewarp calculations DistortionShader->SetUniform4x4f("EyeRotationStart", Matrix4f(timeWarpMatrices[0])); DistortionShader->SetUniform4x4f("EyeRotationEnd", Matrix4f(timeWarpMatrices[1])); diff --git a/LibOVR/Src/CAPI/D3D1X/CAPI_D3D9_DistortionRenderer.cpp b/LibOVR/Src/CAPI/D3D1X/CAPI_D3D9_DistortionRenderer.cpp index a685191..5ede0b8 100644 --- a/LibOVR/Src/CAPI/D3D1X/CAPI_D3D9_DistortionRenderer.cpp +++ b/LibOVR/Src/CAPI/D3D1X/CAPI_D3D9_DistortionRenderer.cpp @@ -156,9 +156,6 @@ void DistortionRenderer::EndFrame(bool swapBuffers) renderEndFrame(); } - if(RegisteredPostDistortionCallback) - RegisteredPostDistortionCallback(device); - if(LatencyTestDrawColor) { // TODO: Support latency tester quad diff --git a/LibOVR/Src/CAPI/D3D1X/CAPI_D3D9_DistortionRenderer.h b/LibOVR/Src/CAPI/D3D1X/CAPI_D3D9_DistortionRenderer.h index be5aa5f..c35bf43 100644 --- a/LibOVR/Src/CAPI/D3D1X/CAPI_D3D9_DistortionRenderer.h +++ b/LibOVR/Src/CAPI/D3D1X/CAPI_D3D9_DistortionRenderer.h @@ -26,8 +26,6 @@ limitations under the License. #include "../../Kernel/OVR_Types.h" -#undef new - #if defined (OVR_OS_WIN32) #define WIN32_LEAN_AND_MEAN #if _MSC_VER < 1700 |