TemporalAA.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // Copyright (C) 2009-2022, Panagiotis Christopoulos Charitos and contributors.
  2. // All rights reserved.
  3. // Code licensed under the BSD License.
  4. // http://www.anki3d.org/LICENSE
  5. #pragma once
  6. #include <AnKi/Renderer/RendererObject.h>
  7. namespace anki {
  8. /// @addtogroup renderer
  9. /// @{
  10. /// Temporal AA resolve.
  11. class TemporalAA : public RendererObject
  12. {
  13. public:
  14. TemporalAA(Renderer* r);
  15. ~TemporalAA();
  16. Error init();
  17. void populateRenderGraph(RenderingContext& ctx);
  18. /// Result is tonemaped.
  19. RenderTargetHandle getTonemappedRt() const
  20. {
  21. return m_runCtx.m_tonemappedRt;
  22. }
  23. RenderTargetHandle getHdrRt() const
  24. {
  25. return m_runCtx.m_renderRt;
  26. }
  27. private:
  28. Array<TexturePtr, 2> m_rtTextures;
  29. Array<Bool, 2> m_rtTexturesImportedOnce = {};
  30. ShaderProgramResourcePtr m_prog;
  31. ShaderProgramPtr m_grProg;
  32. RenderTargetDescription m_tonemappedRtDescr;
  33. FramebufferDescription m_fbDescr;
  34. class
  35. {
  36. public:
  37. RenderTargetHandle m_renderRt;
  38. RenderTargetHandle m_historyRt;
  39. RenderTargetHandle m_tonemappedRt;
  40. } m_runCtx;
  41. Error initInternal();
  42. };
  43. /// @}
  44. } // end namespace anki