qzdoom/src/gl/shaders/gl_ambientshader.h

85 lines
1.6 KiB
C
Raw Normal View History

2016-08-29 11:10:22 +00:00
#ifndef __GL_AMBIENTSHADER_H
#define __GL_AMBIENTSHADER_H
#include "gl_shaderprogram.h"
class FLinearDepthShader
{
public:
2016-09-03 02:12:00 +00:00
void Bind(bool multisample);
2016-08-29 11:10:22 +00:00
2016-09-03 02:12:00 +00:00
FBufferedUniformSampler DepthTexture[2];
FBufferedUniformSampler ColorTexture[2];
2016-09-03 02:12:00 +00:00
FBufferedUniform1i SampleCount[2];
FBufferedUniform1f LinearizeDepthA[2];
FBufferedUniform1f LinearizeDepthB[2];
FBufferedUniform1f InverseDepthRangeA[2];
FBufferedUniform1f InverseDepthRangeB[2];
FBufferedUniform2f Scale[2];
FBufferedUniform2f Offset[2];
2016-08-29 11:10:22 +00:00
private:
2016-09-03 02:12:00 +00:00
FShaderProgram mShader[2];
2016-08-29 11:10:22 +00:00
};
class FSSAOShader
{
public:
void Bind();
FBufferedUniformSampler DepthTexture;
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-08-29 11:10:22 +00:00
private:
2016-09-24 17:26:25 +00:00
enum Quality
{
Off,
LowQuality,
MediumQuality,
HighQuality,
NumQualityModes
};
FString GetDefines(int mode);
FShaderProgram mShader[NumQualityModes];
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:
void Bind(bool multisample);
2016-09-02 03:45:00 +00:00
FBufferedUniformSampler AODepthTexture[2];
FBufferedUniformSampler SceneDataTexture[2];
FBufferedUniform1i SampleCount[2];
FBufferedUniform2f Scale[2];
FBufferedUniform2f Offset[2];
2016-09-02 03:45:00 +00:00
private:
FShaderProgram mShader[2];
2016-09-02 03:45:00 +00:00
};
2016-08-29 11:10:22 +00:00
#endif