VolumetricLightingAccumulation.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. ANKI_CVAR2(NumericCVar<F32>, Render, VolumetricLightingAccumulation, QualityXY, 4.0f, 1.0f, 16.0f, "Quality of XY dimensions of volumetric lights")
  11. ANKI_CVAR2(NumericCVar<F32>, Render, VolumetricLightingAccumulation, QualityZ, 4.0f, 1.0f, 16.0f, "Quality of Z dimension of volumetric lights")
  12. ANKI_CVAR2(NumericCVar<U32>, Render, VolumetricLightingAccumulation, FinalZSplit, 26, 1, 256,
  13. "Final cluster split that will recieve volumetric lights")
  14. /// Volumetric lighting. It accumulates lighting in a volume texture.
  15. class VolumetricLightingAccumulation : public RendererObject
  16. {
  17. public:
  18. Error init();
  19. /// Populate the rendergraph.
  20. void populateRenderGraph(RenderingContext& ctx);
  21. RenderTargetHandle getRt() const
  22. {
  23. return m_runCtx.m_rts[1];
  24. }
  25. private:
  26. ShaderProgramResourcePtr m_prog;
  27. ShaderProgramPtr m_grProg;
  28. Array<TexturePtr, 2> m_rtTextures;
  29. ImageResourcePtr m_noiseImage;
  30. Array<U32, 3> m_volumeSize;
  31. class
  32. {
  33. public:
  34. Array<RenderTargetHandle, 2> m_rts;
  35. } m_runCtx; ///< Runtime context.
  36. };
  37. /// @}
  38. } // end namespace anki