GBufferPost.h 982 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // Copyright (C) 2009-2021, 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. {
  9. /// @addtogroup renderer
  10. /// @{
  11. /// Applies SSAO and decals to the GBuffer. It's a seperate pass because it requres the depth buffer.
  12. class GBufferPost : public RendererObject
  13. {
  14. public:
  15. GBufferPost(Renderer* r)
  16. : RendererObject(r)
  17. {
  18. }
  19. ~GBufferPost();
  20. ANKI_USE_RESULT Error init(const ConfigSet& cfg);
  21. /// Populate the rendergraph.
  22. void populateRenderGraph(RenderingContext& ctx);
  23. private:
  24. ShaderProgramResourcePtr m_prog;
  25. ShaderProgramPtr m_grProg;
  26. FramebufferDescription m_fbDescr;
  27. class
  28. {
  29. public:
  30. RenderingContext* m_ctx ANKI_DEBUG_CODE(= nullptr);
  31. } m_runCtx;
  32. ANKI_USE_RESULT Error initInternal(const ConfigSet& cfg);
  33. void run(RenderPassWorkContext& rgraphCtx);
  34. };
  35. /// @}
  36. } // end namespace anki