MotionVectors.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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/Gr.h>
  7. #include <AnKi/Renderer/RendererObject.h>
  8. namespace anki {
  9. /// @addtogroup renderer
  10. /// @{
  11. /// Motion vector calculation.
  12. class MotionVectors : public RendererObject
  13. {
  14. public:
  15. MotionVectors()
  16. {
  17. registerDebugRenderTarget("MotionVectors");
  18. }
  19. Error init();
  20. void populateRenderGraph(RenderingContext& ctx);
  21. RenderTargetHandle getMotionVectorsRt() const
  22. {
  23. return m_runCtx.m_motionVectorsRtHandle;
  24. }
  25. void getDebugRenderTarget([[maybe_unused]] CString rtName, Array<RenderTargetHandle, U32(DebugRenderTargetRegister::kCount)>& handles,
  26. [[maybe_unused]] DebugRenderTargetDrawStyle& drawStyle) const override
  27. {
  28. handles[0] = m_runCtx.m_motionVectorsRtHandle;
  29. }
  30. private:
  31. ShaderProgramResourcePtr m_prog;
  32. ShaderProgramPtr m_grProg;
  33. RenderTargetDesc m_motionVectorsRtDescr;
  34. class
  35. {
  36. public:
  37. RenderTargetHandle m_motionVectorsRtHandle;
  38. } m_runCtx;
  39. };
  40. /// @}
  41. } // end namespace anki