Reimplement cascaded shadow maps blending via dithering

This commit is contained in:
Wojtek Figat
2024-04-05 10:59:34 +02:00
parent 8bd409e95d
commit 0cc6669cbd
11 changed files with 46 additions and 52 deletions

View File

@@ -11,7 +11,6 @@
#include "Engine/Graphics/RenderTools.h"
#include "Engine/Graphics/RenderTargetPool.h"
#include "Engine/Graphics/RenderBuffers.h"
#include "Engine/Engine/Time.h"
#include "Engine/Platform/Window.h"
#include "Utils/MultiScaler.h"
#include "Engine/Engine/Engine.h"
@@ -247,13 +246,7 @@ void ScreenSpaceReflectionsPass::Render(RenderContext& renderContext, GPUTexture
data.TemporalEffect = useTemporal ? 1.0f : 0.0f;
if (useTemporal)
{
const float time = Time::Draw.UnscaledTime.GetTotalSeconds();
// Keep time in smaller range to prevent temporal noise errors
const double scale = 10;
const double integral = round(time / scale) * scale;
data.TemporalTime = static_cast<float>(time - integral);
data.TemporalTime = RenderTools::ComputeTemporalTime();
buffers->LastFrameTemporalSSR = Engine::FrameCount;
if (!buffers->TemporalSSR || buffers->TemporalSSR->Width() != temporalWidth || buffers->TemporalSSR->Height() != temporalHeight)
{