// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. #pragma once #include "../RendererPass.h" #include "Engine/Graphics/GPUPipelineStatePermutations.h" /// /// Temporal Anti-Aliasing effect. /// class TAA : public RendererPass { private: PACK_STRUCT(struct Data { Vector4 ScreenSize; Vector4 TaaJitterStrength; Vector4 FinalBlendParameters; }); AssetReference _shader; GPUPipelineStatePermutationsPs<2> _psTAA; public: /// /// Determinates whenever this pass requires motion vectors rendering. /// /// The rendering context. /// True if need to render motion vectors, otherwise false. static bool NeedMotionVectors(RenderContext& renderContext); /// /// Performs AA pass rendering for the input task. /// /// The rendering context. /// The input render target. /// The output render target. void Render(RenderContext& renderContext, GPUTexture* input, GPUTextureView* output); private: #if COMPILE_WITH_DEV_ENV void OnShaderReloading(Asset* obj) { _psTAA.Release(); invalidateResources(); } #endif public: // [RendererPass] String ToString() const override { return TEXT("TAA"); } bool Init() override; void Dispose() override; protected: // [RendererPass] bool setupResources() override; };