Add **Contrast Adaptive Sharpening (CAS)** filter pass

#2423
This commit is contained in:
Muzz
2024-08-29 19:01:37 +02:00
committed by Wojtek Figat
parent 499ef51875
commit 09737023a1
8 changed files with 273 additions and 13 deletions

View File

@@ -65,10 +65,10 @@ void FXAA::Dispose()
void FXAA::Render(RenderContext& renderContext, GPUTexture* input, GPUTextureView* output)
{
auto context = GPUDevice::Instance->GetMainContext();
context->SetRenderTarget(output);
if (checkIfSkipPass())
{
// Resources are missing. Do not perform rendering, just copy input frame.
context->SetRenderTarget(output);
context->Draw(input);
return;
}
@@ -83,7 +83,6 @@ void FXAA::Render(RenderContext& renderContext, GPUTexture* input, GPUTextureVie
context->BindSR(0, input);
// Render
context->SetRenderTarget(output);
const auto qualityLevel = Math::Clamp(static_cast<int32>(Graphics::AAQuality), 0, static_cast<int32>(Quality::MAX) - 1);
context->SetState(_psFXAA.Get(qualityLevel));
context->DrawFullscreenTriangle();