#ifndef WORLDSHADER_H #define WORLDSHADER_H #include "client/engine/shader/ShaderProgram.h" class WorldShader { public: WorldShader(); virtual ~WorldShader(); bool init(); void resize(); void preRender(const float* projMatrix); void bindPositionTexture(unsigned int textureUnit); void bindNormalTexture(unsigned int textureUnit); void bindColorTexture(unsigned int textureUnit); void bindDepthTexture(unsigned int textureUnit); void setViewMatrix(const float* data); void setModelMatrix(const float* data); private: // shader ShaderProgram program; // framebuffer GLuint framebuffer = 0; // textures GLuint positionTexture = 0; GLuint normalTexture = 0; GLuint colorTexture = 0; GLuint depthTexture = 0; // uniforms locations GLint unifProjMatrix = 0; GLint unifViewMatrix = 0; GLint unifModelMatrix = 0; }; #endif