HistoryLength.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // Copyright (C) 2009-present, 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. /// Compute the history length (aka disocclusion length)
  11. class HistoryLength : public RendererObject
  12. {
  13. public:
  14. HistoryLength()
  15. {
  16. registerDebugRenderTarget("HistoryLen");
  17. }
  18. Error init();
  19. void populateRenderGraph(RenderingContext& ctx);
  20. void getDebugRenderTarget([[maybe_unused]] CString rtName, Array<RenderTargetHandle, U32(DebugRenderTargetRegister::kCount)>& handles,
  21. [[maybe_unused]] DebugRenderTargetDrawStyle& drawStyle) const override
  22. {
  23. handles[0] = m_runCtx.m_rt;
  24. drawStyle = DebugRenderTargetDrawStyle::kRedOnly;
  25. }
  26. RenderTargetHandle getRt() const
  27. {
  28. return m_runCtx.m_rt;
  29. }
  30. private:
  31. ShaderProgramResourcePtr m_prog;
  32. ShaderProgramPtr m_grProg;
  33. Array<TexturePtr, 2> m_historyLenTextures;
  34. Bool m_texturesImportedOnce = false;
  35. class
  36. {
  37. public:
  38. RenderTargetHandle m_rt;
  39. } m_runCtx;
  40. };
  41. /// @}
  42. } // namespace anki