WorldShadowShader.h 707 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef WORLDSHADOWMAPPINGSHADER_H
  2. #define WORLDSHADOWMAPPINGSHADER_H
  3. #include "ShaderProgram.h"
  4. class WorldShadowShader
  5. {
  6. public:
  7. WorldShadowShader();
  8. virtual ~WorldShadowShader();
  9. bool init();
  10. void resize();
  11. void preRender(const float* projMatrix);
  12. void bindDepthTexture(unsigned int textureUnit);
  13. void setViewMatrix(const float* data);
  14. void setModelMatrix(const float* data);
  15. private:
  16. // shader
  17. ShaderProgram program;
  18. // framebuffer
  19. GLuint framebuffer = 0;
  20. // textures
  21. GLuint depthTexture = 0;
  22. // uniforms locations
  23. GLint unifProjMatrix = 0;
  24. GLint unifViewMatrix = 0;
  25. GLint unifModelMatrix = 0;
  26. };
  27. #endif