FinalComposite.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. #include <AnKi/Resource/ImageResource.h>
  8. namespace anki
  9. {
  10. /// @addtogroup renderer
  11. /// @{
  12. /// Post-processing stage.
  13. class FinalComposite : public RendererObject
  14. {
  15. public:
  16. FinalComposite(Renderer* r);
  17. ~FinalComposite();
  18. ANKI_USE_RESULT Error init(const ConfigSet& config);
  19. /// Populate the rendergraph.
  20. void populateRenderGraph(RenderingContext& ctx);
  21. /// Load the color grading texture.
  22. Error loadColorGradingTextureImage(CString filename);
  23. private:
  24. static const U LUT_SIZE = 16;
  25. FramebufferDescription m_fbDescr;
  26. ShaderProgramResourcePtr m_prog;
  27. Array<ShaderProgramPtr, 2> m_grProgs; ///< [Debug on or off]
  28. ShaderProgramResourcePtr m_defaultVisualizeRenderTargetProg;
  29. ShaderProgramPtr m_defaultVisualizeRenderTargetGrProg;
  30. ImageResourcePtr m_lut; ///< Color grading lookup texture.
  31. ImageResourcePtr m_blueNoise;
  32. class
  33. {
  34. public:
  35. RenderingContext* m_ctx = nullptr;
  36. } m_runCtx;
  37. ANKI_USE_RESULT Error initInternal(const ConfigSet& config);
  38. void run(RenderingContext& ctx, RenderPassWorkContext& rgraphCtx);
  39. };
  40. /// @}
  41. } // end namespace anki