From e610247392fad529540a8276e0516489deca6763 Mon Sep 17 00:00:00 2001 From: madsbuvi Date: Mon, 22 Feb 2021 16:25:30 +0100 Subject: [PATCH] gamma debugging --- apps/openmw/mwvr/vrviewer.cpp | 6 +++++- files/settings-default.cfg | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwvr/vrviewer.cpp b/apps/openmw/mwvr/vrviewer.cpp index 17b565b22..f5b321bf2 100644 --- a/apps/openmw/mwvr/vrviewer.cpp +++ b/apps/openmw/mwvr/vrviewer.cpp @@ -392,8 +392,12 @@ namespace MWVR mFramebuffer->blit(gc, 0, 0, mFramebuffer->width(), mFramebuffer->height(), 0, 0, mMsaaResolveTexture->width(), mMsaaResolveTexture->height(), GL_COLOR_BUFFER_BIT, GL_NEAREST); - if(!applyGamma(gc, *mGammaResolveTexture, *mMsaaResolveTexture)) + bool shouldDoGamma = Settings::Manager::getBool("gamma postprocessing", "VR Debug"); + if (!shouldDoGamma || !applyGamma(gc, *mGammaResolveTexture, *mMsaaResolveTexture)) + { + mGammaResolveTexture->bindFramebuffer(gc, GL_FRAMEBUFFER_EXT); mMsaaResolveTexture->blit(gc, 0, 0, mMsaaResolveTexture->width(), mMsaaResolveTexture->height(), 0, 0, mGammaResolveTexture->width(), mGammaResolveTexture->height(), GL_COLOR_BUFFER_BIT, GL_NEAREST); + } mFramebuffer->blit(gc, 0, 0, mFramebuffer->width(), mFramebuffer->height(), 0, 0, mGammaResolveTexture->width(), mGammaResolveTexture->height(), GL_DEPTH_BUFFER_BIT, GL_NEAREST); diff --git a/files/settings-default.cfg b/files/settings-default.cfg index 4b4d15407..a10ec0c9a 100644 --- a/files/settings-default.cfg +++ b/files/settings-default.cfg @@ -1019,11 +1019,14 @@ hand directed movement = false # Valid options are: top, wrist left hand hud position = wrist -# If true, OpenMW will try to use DirectX swapchains instead of OpenGL swapchains. They are HW bridged to OpenGL using the WGL_NV_DX_interop2 extension. +# If true, OpenMW-VR will try to use DirectX swapchains instead of OpenGL swapchains. They are HW bridged to OpenGL using the WGL_NV_DX_interop2 extension. # As the general quality of OpenXR DirectX runtimes is better than OpenGL runtimes, i default this to true. Prefer DirectX swapchains = true [VR Debug] +# If true, OpenMW-VR will enable gamma postprocessing +gamma postprocessing = true + # Openmw will sync with openxr at the beginning of this phase in the rendering pipeline. From early to late in the pipeline the options are update, cull, draw, and swap in that order. If you experience visual glitches such as frames jittering across your vision, try changing this to an earlier phase. openxr sync phase = draw