Tonemapping.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. /// Tonemapping.
  11. class Tonemapping : public RendererObject
  12. {
  13. public:
  14. Error init();
  15. void importRenderTargets(RenderingContext& ctx);
  16. void populateRenderGraph(RenderingContext& ctx);
  17. /// @copydoc m_exposureAndAvgLuminance1x1
  18. RenderTargetHandle getExposureAndAvgLuminanceRt() const
  19. {
  20. return m_runCtx.m_exposureLuminanceHandle;
  21. }
  22. RenderTargetHandle getRt() const
  23. {
  24. return m_runCtx.m_rt;
  25. }
  26. private:
  27. class
  28. {
  29. public:
  30. ShaderProgramResourcePtr m_prog;
  31. ShaderProgramPtr m_grProg;
  32. U32 m_inputTexMip;
  33. /// This is a 1x1 2 component texture where R is the exposure and G the average luminance. It's not tracked in
  34. /// rendergraph depedencies. We don't care to track it because it affects the eye adaptation.
  35. TexturePtr m_exposureAndAvgLuminance1x1;
  36. } m_expAndAvgLum;
  37. class
  38. {
  39. public:
  40. ShaderProgramResourcePtr m_prog;
  41. ShaderProgramPtr m_grProg;
  42. RenderTargetDesc m_rtDesc;
  43. ImageResourcePtr m_lut; ///< Color grading lookup texture.
  44. } m_tonemapping;
  45. class
  46. {
  47. public:
  48. RenderTargetHandle m_exposureLuminanceHandle;
  49. RenderTargetHandle m_rt;
  50. } m_runCtx;
  51. };
  52. /// @}
  53. } // end namespace anki