Lf.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. // Copyright (C) 2009-2016, Panagiotis Christopoulos Charitos.
  2. // All rights reserved.
  3. // Code licensed under the BSD License.
  4. // http://www.anki3d.org/LICENSE
  5. #pragma once
  6. #include <anki/renderer/RenderingPass.h>
  7. #include <anki/Gr.h>
  8. #include <anki/resource/ShaderResource.h>
  9. #include <anki/resource/TextureResource.h>
  10. namespace anki
  11. {
  12. /// @addtogroup renderer
  13. /// @{
  14. /// Lens flare rendering pass. Part of forward shading.
  15. class Lf : public RenderingPass
  16. {
  17. anki_internal:
  18. Lf(Renderer* r)
  19. : RenderingPass(r)
  20. {
  21. }
  22. ~Lf();
  23. ANKI_USE_RESULT Error init(const ConfigSet& config);
  24. void runOcclusionTests(CommandBufferPtr& cmdb);
  25. void run(CommandBufferPtr& cmdb);
  26. private:
  27. // Occlusion query
  28. ShaderResourcePtr m_occlusionVert;
  29. ShaderResourcePtr m_occlusionFrag;
  30. PipelinePtr m_occlusionPpline;
  31. ResourceGroupPtr m_occlusionRcGroup;
  32. // Sprite billboards
  33. ShaderResourcePtr m_realVert;
  34. ShaderResourcePtr m_realFrag;
  35. PipelinePtr m_realPpline;
  36. U8 m_maxSpritesPerFlare;
  37. U8 m_maxFlares;
  38. U16 m_maxSprites;
  39. ANKI_USE_RESULT Error initSprite(const ConfigSet& config);
  40. ANKI_USE_RESULT Error initOcclusion(const ConfigSet& config);
  41. ANKI_USE_RESULT Error initInternal(const ConfigSet& initializer);
  42. };
  43. /// @}
  44. } // end namespace anki