From dbdcef3d332dde681ee7f813edff3ffd381627a1 Mon Sep 17 00:00:00 2001 From: samcake Date: Wed, 6 Sep 2017 17:40:59 -0700 Subject: [PATCH] making the 9 fetch the default for the constraining pass --- libraries/render-utils/src/AntialiasingEffect.cpp | 6 +++++- libraries/render-utils/src/taa.slf | 4 ++-- libraries/render-utils/src/taa.slh | 11 +++++------ scripts/developer/utilities/render/antialiasing.qml | 13 ++++--------- 4 files changed, 16 insertions(+), 18 deletions(-) diff --git a/libraries/render-utils/src/AntialiasingEffect.cpp b/libraries/render-utils/src/AntialiasingEffect.cpp index 86a1ea877d..bed111aa8f 100644 --- a/libraries/render-utils/src/AntialiasingEffect.cpp +++ b/libraries/render-utils/src/AntialiasingEffect.cpp @@ -336,7 +336,7 @@ void Antialiasing::run(const render::RenderContextPointer& renderContext, const for (int i = 0; i < 2; i++) { _antialiasingBuffer[i] = gpu::FramebufferPointer(gpu::Framebuffer::create("antialiasing")); auto format = gpu::Element::COLOR_SRGBA_32; // DependencyManager::get()->getLightingTexture()->getTexelFormat(); - auto defaultSampler = gpu::Sampler(gpu::Sampler::FILTER_MIN_MAG_POINT); + auto defaultSampler = gpu::Sampler(gpu::Sampler::FILTER_MIN_MAG_LINEAR); _antialiasingTexture[i] = gpu::Texture::createRenderBuffer(format, width, height, gpu::Texture::SINGLE_MIP, defaultSampler); _antialiasingBuffer[i]->setRenderBuffer(0, _antialiasingTexture[i]); } @@ -490,6 +490,10 @@ void JitterSample::configure(const Config& config) { if (_jitterBuffer->currentIndex != pausedIndex) { _jitterBuffer.edit().currentIndex = pausedIndex; } + } else { + if (_jitterBuffer->currentIndex == SampleSequence::SEQUENCE_LENGTH) { + _jitterBuffer.edit().currentIndex = config.getIndex(); + } } _scale = config.scale; } diff --git a/libraries/render-utils/src/taa.slf b/libraries/render-utils/src/taa.slf index fb68ecbf6a..c82ba34c37 100644 --- a/libraries/render-utils/src/taa.slf +++ b/libraries/render-utils/src/taa.slf @@ -32,7 +32,7 @@ void main() { // Debug region before debug or fxaa region X float distToRegionFXAA = fragUV.x - taa_getRegionFXAA().x; if (distToRegionFXAA > 0.0) { - outFragColor = vec4(taa_evalTXAA(fragUV), 1.0); + outFragColor = vec4(taa_evalFXAA(fragUV), 1.0); return; } @@ -41,7 +41,7 @@ void main() { vec3 sourceColor; vec3 historyColor; - vec2 prevFragUV = taa_fetchSourceAndHistory(fragUV, fragVel, sourceColor, historyColor); + vec2 prevFragUV = taa_fetchSourceAndHistory(nearFragUV.xy, fragVel, sourceColor, historyColor); vec3 nextColor = mix(historyColor, sourceColor, params.blend); diff --git a/libraries/render-utils/src/taa.slh b/libraries/render-utils/src/taa.slh index c6528aaa61..1c97fd39ef 100644 --- a/libraries/render-utils/src/taa.slh +++ b/libraries/render-utils/src/taa.slh @@ -219,8 +219,7 @@ mat3 taa_evalNeighbourColorRegion(vec3 sourceColor, vec2 fragUV, vec2 fragVeloci vec2 texelSize = getInvWidthHeight(); vec3 cmin, cmax, cavg; - if (taa_constrainColor9Taps()) { - + #if MINMAX_3X3_ROUNDED vec2 du = vec2(texelSize.x, 0.0); vec2 dv = vec2(0.0, texelSize.y); @@ -228,7 +227,7 @@ mat3 taa_evalNeighbourColorRegion(vec3 sourceColor, vec2 fragUV, vec2 fragVeloci vec3 ctc = taa_fetchSourceMap(fragUV - dv).rgb; vec3 ctr = taa_fetchSourceMap(fragUV - dv + du).rgb; vec3 cml = taa_fetchSourceMap(fragUV - du).rgb; - vec3 cmc = taa_fetchSourceMap(fragUV).rgb; // could resuse the same osurce sample isn't it ? + vec3 cmc = sourceColor; //taa_fetchSourceMap(fragUV).rgb; // could resuse the same osurce sample isn't it ? vec3 cmr = taa_fetchSourceMap(fragUV + du).rgb; vec3 cbl = taa_fetchSourceMap(fragUV + dv - du).rgb; vec3 cbc = taa_fetchSourceMap(fragUV + dv).rgb; @@ -251,7 +250,7 @@ mat3 taa_evalNeighbourColorRegion(vec3 sourceColor, vec2 fragUV, vec2 fragVeloci cmax = 0.5 * (cmax + cmax5); cavg = 0.5 * (cavg + cavg5); #endif - } else { + #else const float _SubpixelThreshold = 0.5; const float _GatherBase = 0.5; const float _GatherSubpixelMotion = 0.1666; @@ -277,7 +276,7 @@ mat3 taa_evalNeighbourColorRegion(vec3 sourceColor, vec2 fragUV, vec2 fragVeloci #elif cavg = (cmin + cmax ) * 0.5; #endif - } + #endif // shrink chroma min-max #if USE_YCOCG @@ -373,7 +372,7 @@ vec3 taa_getVelocityColorAboveThreshold(float velocityPixLength) { } -vec3 taa_evalTXAA(vec2 fragUV) { +vec3 taa_evalFXAA(vec2 fragUV) { vec2 texelSize = getInvWidthHeight(); diff --git a/scripts/developer/utilities/render/antialiasing.qml b/scripts/developer/utilities/render/antialiasing.qml index 37f0a7d2d7..64502d32e8 100644 --- a/scripts/developer/utilities/render/antialiasing.qml +++ b/scripts/developer/utilities/render/antialiasing.qml @@ -57,6 +57,7 @@ Rectangle { } } } + Separator {} Row { spacing: 10 @@ -64,11 +65,11 @@ Rectangle { text: { var state = 2 - (Render.getConfig("RenderMainView.JitterCam").freeze * 1 - Render.getConfig("RenderMainView.JitterCam").stop * 2); if (state === 2) { - return ">>" + return "Jitter" } else if (state === 1) { - return "|" + Render.getConfig("RenderMainView.JitterCam").index + "|" + return "Paused at " + Render.getConfig("RenderMainView.JitterCam").index + "" } else { - return "[]" + return "No Jitter" } } onClicked: { Render.getConfig("RenderMainView.JitterCam").cycleStopPauseRun(); } @@ -106,12 +107,6 @@ Rectangle { checked: Render.getConfig("RenderMainView.Antialiasing")["constrainColor"] onCheckedChanged: { Render.getConfig("RenderMainView.Antialiasing")["constrainColor"] = checked } } - HifiControls.CheckBox { - boxSize: 20 - text: "Constrain color 9 Taps" - checked: Render.getConfig("RenderMainView.Antialiasing")["constrainColor9Taps"] - onCheckedChanged: { Render.getConfig("RenderMainView.Antialiasing")["constrainColor9Taps"] = checked } - } HifiControls.CheckBox { boxSize: 20 text: "Clip / Clamp History color"