Tonemapping.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // Copyright (C) 2009-2022, 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. Tonemapping(Renderer* r)
  15. : RendererObject(r)
  16. {
  17. }
  18. Error init();
  19. void importRenderTargets(RenderingContext& ctx);
  20. /// Populate the rendergraph.
  21. void populateRenderGraph(RenderingContext& ctx);
  22. /// @copydoc m_exposureAndAvgLuminance1x1
  23. RenderTargetHandle getRt() const
  24. {
  25. return m_runCtx.m_exposureLuminanceHandle;
  26. }
  27. private:
  28. ShaderProgramResourcePtr m_prog;
  29. ShaderProgramPtr m_grProg;
  30. U32 m_inputTexMip;
  31. /// This is a 1x1 2 component texture where R is the exposure and G the average luminance. It's not tracked in
  32. /// rendergraph depedencies. We don't care to track it because it affects the eye adaptation.
  33. TexturePtr m_exposureAndAvgLuminance1x1;
  34. class
  35. {
  36. public:
  37. RenderTargetHandle m_exposureLuminanceHandle;
  38. } m_runCtx;
  39. Error initInternal();
  40. };
  41. /// @}
  42. } // end namespace anki