ProbeReflections.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. #include <AnKi/Renderer/Utils/TraditionalDeferredShading.h>
  8. #include <AnKi/Resource/ImageResource.h>
  9. namespace anki {
  10. /// @addtogroup renderer
  11. /// @{
  12. ANKI_CVAR2(NumericCVar<U32>, Render, ProbeReflections, ShadowMapResolution, 64, 4, 2048, "Reflection probe shadow resolution")
  13. /// Probe reflections.
  14. class ProbeReflections : public RendererObject
  15. {
  16. friend class IrTask;
  17. public:
  18. Error init();
  19. /// Populate the rendergraph.
  20. void populateRenderGraph(RenderingContext& ctx);
  21. U getReflectionTextureMipmapCount() const
  22. {
  23. return m_lightShading.m_mipCount;
  24. }
  25. Texture& getIntegrationLut() const
  26. {
  27. return m_integrationLut->getTexture();
  28. }
  29. RenderTargetHandle getCurrentlyRefreshedReflectionRt() const
  30. {
  31. ANKI_ASSERT(m_runCtx.m_probeTex.isValid());
  32. return m_runCtx.m_probeTex;
  33. }
  34. Bool getHasCurrentlyRefreshedReflectionRt() const
  35. {
  36. return m_runCtx.m_probeTex.isValid();
  37. }
  38. private:
  39. class
  40. {
  41. public:
  42. U32 m_tileSize = 0;
  43. Array<RenderTargetDesc, kGBufferColorRenderTargetCount> m_colorRtDescrs;
  44. RenderTargetDesc m_depthRtDescr;
  45. } m_gbuffer; ///< G-buffer pass.
  46. class LS
  47. {
  48. public:
  49. U32 m_tileSize = 0;
  50. U8 m_mipCount = 0;
  51. TraditionalDeferredLightShading m_deferred;
  52. } m_lightShading; ///< Light shading.
  53. class
  54. {
  55. public:
  56. RenderTargetDesc m_rtDescr;
  57. } m_shadowMapping;
  58. class
  59. {
  60. public:
  61. RenderTargetHandle m_probeTex;
  62. } m_runCtx;
  63. // Other
  64. ImageResourcePtr m_integrationLut;
  65. };
  66. /// @}
  67. } // end namespace anki