123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- #ifndef SSAOSHADER_H
- #define SSAOSHADER_H
- #include "client/engine/shader/ShaderProgram.h"
- class SSAOShader
- {
- public:
- SSAOShader();
- virtual ~SSAOShader();
-
- bool init();
- void resize();
- void preRender(const float* projMatrix);
-
- void bindTexture(unsigned int textureUnit);
- void bindNoiseTexture(unsigned int textureUnit);
-
- void setNumberOfSamples(int amount);
- int getNumberOfSamples() const;
- void setSampleRadius(float sampleRadius);
- float getSampleRadius() const;
-
- private:
- // shader
- ShaderProgram program;
- // framebuffer
- GLuint framebuffer = 0;
- // textures
- GLuint texture = 0;
- GLuint noiseTexture = 0;
- // uniform data
- int numberOfSamples = 32;
- float radius = 2.5f;
- // uniforms locations
- GLint unifProjMatrix = 0;
- GLint unifNumberOfSamples = 0;
- GLint unifRadius = 0;
- GLint unifWidth = 0;
- GLint unifHeight = 0;
- };
- #endif
|