2016-08-29 11:10:22 +00:00
|
|
|
#ifndef __GL_AMBIENTSHADER_H
|
|
|
|
#define __GL_AMBIENTSHADER_H
|
|
|
|
|
|
|
|
#include "gl_shaderprogram.h"
|
|
|
|
|
|
|
|
class FLinearDepthShader
|
|
|
|
{
|
|
|
|
public:
|
2016-10-05 05:57:27 +00:00
|
|
|
void Bind();
|
|
|
|
|
|
|
|
FBufferedUniformSampler DepthTexture;
|
|
|
|
FBufferedUniformSampler ColorTexture;
|
2016-10-09 04:17:48 +00:00
|
|
|
FBufferedUniform1i SampleIndex;
|
2016-10-05 05:57:27 +00:00
|
|
|
FBufferedUniform1f LinearizeDepthA;
|
|
|
|
FBufferedUniform1f LinearizeDepthB;
|
|
|
|
FBufferedUniform1f InverseDepthRangeA;
|
|
|
|
FBufferedUniform1f InverseDepthRangeB;
|
|
|
|
FBufferedUniform2f Scale;
|
|
|
|
FBufferedUniform2f Offset;
|
2016-08-29 11:10:22 +00:00
|
|
|
|
|
|
|
private:
|
2016-10-05 05:57:27 +00:00
|
|
|
std::unique_ptr<FShaderProgram> mShader;
|
|
|
|
bool mMultisample = false;
|
2016-08-29 11:10:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class FSSAOShader
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
void Bind();
|
|
|
|
|
|
|
|
FBufferedUniformSampler DepthTexture;
|
2016-10-05 05:57:27 +00:00
|
|
|
FBufferedUniformSampler NormalTexture;
|
2016-08-29 23:09:21 +00:00
|
|
|
FBufferedUniformSampler RandomTexture;
|
2016-08-29 11:10:22 +00:00
|
|
|
FBufferedUniform2f UVToViewA;
|
|
|
|
FBufferedUniform2f UVToViewB;
|
|
|
|
FBufferedUniform2f InvFullResolution;
|
|
|
|
FBufferedUniform1f NDotVBias;
|
|
|
|
FBufferedUniform1f NegInvR2;
|
|
|
|
FBufferedUniform1f RadiusToScreen;
|
|
|
|
FBufferedUniform1f AOMultiplier;
|
2016-08-29 23:09:21 +00:00
|
|
|
FBufferedUniform1f AOStrength;
|
2016-10-06 05:36:49 +00:00
|
|
|
FBufferedUniform2f Scale;
|
|
|
|
FBufferedUniform2f Offset;
|
2016-10-09 04:17:48 +00:00
|
|
|
FBufferedUniform1i SampleIndex;
|
2016-08-29 11:10:22 +00:00
|
|
|
|
|
|
|
private:
|
2016-09-24 17:26:25 +00:00
|
|
|
enum Quality
|
|
|
|
{
|
|
|
|
Off,
|
|
|
|
LowQuality,
|
|
|
|
MediumQuality,
|
|
|
|
HighQuality,
|
|
|
|
NumQualityModes
|
|
|
|
};
|
|
|
|
|
2016-10-05 05:57:27 +00:00
|
|
|
FString GetDefines(int mode, bool multisample);
|
2016-09-24 17:26:25 +00:00
|
|
|
|
2016-10-05 05:57:27 +00:00
|
|
|
std::unique_ptr<FShaderProgram> mShader;
|
|
|
|
Quality mCurrentQuality = Off;
|
|
|
|
bool mMultisample = false;
|
2016-08-29 11:10:22 +00:00
|
|
|
};
|
|
|
|
|
2016-09-02 03:45:00 +00:00
|
|
|
class FDepthBlurShader
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
void Bind(bool vertical);
|
|
|
|
|
|
|
|
FBufferedUniformSampler AODepthTexture[2];
|
|
|
|
FBufferedUniform1f BlurSharpness[2];
|
|
|
|
FBufferedUniform2f InvFullResolution[2];
|
|
|
|
FBufferedUniform1f PowExponent[2];
|
|
|
|
|
|
|
|
private:
|
|
|
|
FShaderProgram mShader[2];
|
|
|
|
};
|
|
|
|
|
|
|
|
class FSSAOCombineShader
|
|
|
|
{
|
|
|
|
public:
|
2016-10-05 05:57:27 +00:00
|
|
|
void Bind();
|
2016-09-02 03:45:00 +00:00
|
|
|
|
2016-10-05 05:57:27 +00:00
|
|
|
FBufferedUniformSampler AODepthTexture;
|
|
|
|
FBufferedUniformSampler SceneFogTexture;
|
|
|
|
FBufferedUniform1i SampleCount;
|
|
|
|
FBufferedUniform2f Scale;
|
|
|
|
FBufferedUniform2f Offset;
|
2016-09-02 03:45:00 +00:00
|
|
|
|
|
|
|
private:
|
2016-10-05 05:57:27 +00:00
|
|
|
std::unique_ptr<FShaderProgram> mShader;
|
|
|
|
bool mMultisample = false;
|
2016-09-02 03:45:00 +00:00
|
|
|
};
|
|
|
|
|
2016-08-29 11:10:22 +00:00
|
|
|
#endif
|