adceccf402
Changed so that the picking pass get drawn once in the beginning so that the AO shatde could calculate AO from the depthbuffer generated during pthe pickingpass. In the ImGUI debugg window there is now sliders to change the behavior of the AO shader. Only the minimum ambient lightning is HardCoded in to the frowardPlus fragmentshaders with a define in the begining.
61 lines
1.5 KiB
C++
61 lines
1.5 KiB
C++
#ifndef SSAOPass_h__
|
|
#define SSAOPass_h__
|
|
|
|
#include "IRenderer.h"
|
|
#include "SSAOPassState.h"
|
|
//#include "LightCullingPass.h" Finalpass om den skall skickas in
|
|
#include "FrameBuffer.h"
|
|
#include "ShaderProgram.h"
|
|
#include "DrawBloomPass.h"
|
|
//#include "Util/UnorderedMapVec2.h"
|
|
#include "Texture.h"
|
|
|
|
class SSAOPass
|
|
{
|
|
public:
|
|
SSAOPass(IRenderer* rendere);
|
|
~SSAOPass() { };
|
|
|
|
void Draw(GLuint depthBuffer, Camera* camera);
|
|
void Setting(float radius, float bias, float contrast, float intensityScale, int numOfSamples, int NumOfTurns);
|
|
void ClearBuffer();
|
|
|
|
//Return the SSAO of the texture sent to Draw
|
|
GLuint SSAOTexture() const { return m_DrawBloomPass->GaussianTexture(); }
|
|
|
|
private:
|
|
void InitializeTexture();
|
|
void InitializeFrameBuffer();
|
|
void InitializeShaderProgram();
|
|
void InitializeBuffer();
|
|
|
|
void GenerateTexture(GLuint* texture, GLenum wrapping, GLenum filtering, glm::vec2 dimensions, GLint internalFormat, GLint format, GLenum type) const;
|
|
|
|
void ComputeAO(GLuint depthBuffer, Camera* camera);
|
|
//void blurHorizontal(GLuint depthBuffer);
|
|
//void blurVertical(GLuint depthBuffer);
|
|
|
|
Model* m_ScreenQuad;
|
|
|
|
const IRenderer* m_Renderer;
|
|
|
|
float m_Radius;
|
|
float m_Bias;
|
|
float m_Contrast;
|
|
float m_IntensityScale;
|
|
int m_NumOfSamples;
|
|
int m_NumOfTurns;
|
|
|
|
GLuint m_SSAOTexture;
|
|
FrameBuffer m_SSAOFramBuffer;
|
|
|
|
GLuint m_SSAOViewSpaceZTexture;
|
|
FrameBuffer m_SSAOViewSpaceZFramBuffer;
|
|
|
|
ShaderProgram* m_SSAOProgram;
|
|
ShaderProgram* m_SSAOViewSpaceZProgram;
|
|
|
|
DrawBloomPass* m_DrawBloomPass;
|
|
};
|
|
|
|
#endif |