MotionVectors.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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(CString rtName, Array<RenderTargetHandle, kMaxDebugRenderTargets>& handles,
  26. [[maybe_unused]] ShaderProgramPtr& optionalShaderProgram) const override
  27. {
  28. if(rtName == "MotionVectors")
  29. {
  30. handles[0] = m_runCtx.m_motionVectorsRtHandle;
  31. }
  32. }
  33. private:
  34. ShaderProgramResourcePtr m_prog;
  35. ShaderProgramPtr m_grProg;
  36. RenderTargetDesc m_motionVectorsRtDescr;
  37. class
  38. {
  39. public:
  40. RenderTargetHandle m_motionVectorsRtHandle;
  41. } m_runCtx;
  42. Error initInternal();
  43. };
  44. /// @}
  45. } // end namespace anki