VolumetricFog.h 1020 B

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/Renderer/RendererObject.h>
  7. namespace anki {
  8. /// @addtogroup renderer
  9. /// @{
  10. /// VolumetricFog effects.
  11. class VolumetricFog : public RendererObject
  12. {
  13. public:
  14. Error init();
  15. /// Populate the rendergraph.
  16. void populateRenderGraph(RenderingContext& ctx);
  17. RenderTargetHandle getRt() const
  18. {
  19. return m_runCtx.m_rt;
  20. }
  21. const Array<U32, 3>& getVolumeSize() const
  22. {
  23. return m_volumeSize;
  24. }
  25. /// Get the last cluster split in Z axis that will be affected by lighting.
  26. U32 getFinalClusterInZ() const
  27. {
  28. return m_finalZSplit;
  29. }
  30. private:
  31. ShaderProgramResourcePtr m_prog;
  32. ShaderProgramPtr m_grProg;
  33. RenderTargetDesc m_rtDescr;
  34. U32 m_finalZSplit = 0;
  35. Array<U32, 3> m_volumeSize;
  36. class
  37. {
  38. public:
  39. RenderTargetHandle m_rt;
  40. } m_runCtx; ///< Runtime context.
  41. };
  42. /// @}
  43. } // end namespace anki