Ms.h 989 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #ifndef ANKI_RENDERER_MS_H
  2. #define ANKI_RENDERER_MS_H
  3. #include "anki/renderer/RenderingPass.h"
  4. #include "anki/gl/Texture.h"
  5. #include "anki/gl/Fbo.h"
  6. #include "anki/renderer/Ez.h"
  7. namespace anki {
  8. /// Material stage also known as G buffer stage. It populates the G buffer
  9. class Ms: public RenderingPass
  10. {
  11. public:
  12. Ms(Renderer* r_)
  13. : RenderingPass(r_), ez(r_)
  14. {}
  15. ~Ms();
  16. /// @name Accessors
  17. /// @{
  18. Texture& getFai0()
  19. {
  20. return fai0[1];
  21. }
  22. const Texture& getFai1() const;
  23. const Texture& getDepthFai() const
  24. {
  25. return depthFai[1];
  26. }
  27. /// @}
  28. void init(const RendererInitializer& initializer);
  29. void run();
  30. private:
  31. Ez ez; /// EarlyZ pass
  32. Array<Fbo, 2> fbo;
  33. Array<Texture, 2> fai0; ///< The FAI for diffuse color, normals and specular
  34. /// Contains the normal and spec power on the MRT case
  35. Array<Texture, 2> fai1;
  36. Array<Texture, 2> depthFai; ///< The FAI for depth
  37. /// Create a G buffer FBO
  38. void createFbo(U index, U samples);
  39. };
  40. } // end namespace anki
  41. #endif