2016-07-28 22:36:43 +00:00
|
|
|
#ifndef __GL_TONEMAPSHADER_H
|
|
|
|
#define __GL_TONEMAPSHADER_H
|
|
|
|
|
|
|
|
#include "gl_shaderprogram.h"
|
|
|
|
|
|
|
|
class FTonemapShader
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
void Bind();
|
|
|
|
|
2016-08-25 23:46:39 +00:00
|
|
|
FBufferedUniformSampler SceneTexture;
|
2016-09-18 13:57:22 +00:00
|
|
|
FBufferedUniformSampler ExposureTexture;
|
2016-08-25 23:46:39 +00:00
|
|
|
FBufferedUniformSampler PaletteLUT;
|
2016-08-23 07:18:18 +00:00
|
|
|
|
|
|
|
static bool IsPaletteMode();
|
2016-07-28 22:36:43 +00:00
|
|
|
|
|
|
|
private:
|
2016-07-29 19:31:20 +00:00
|
|
|
enum TonemapMode
|
|
|
|
{
|
|
|
|
None,
|
|
|
|
Uncharted2,
|
|
|
|
HejlDawson,
|
|
|
|
Reinhard,
|
|
|
|
Linear,
|
2016-08-23 07:18:18 +00:00
|
|
|
Palette,
|
2016-07-29 19:31:20 +00:00
|
|
|
NumTonemapModes
|
|
|
|
};
|
|
|
|
|
|
|
|
static const char *GetDefines(int mode);
|
|
|
|
|
|
|
|
FShaderProgram mShader[NumTonemapModes];
|
2016-07-28 22:36:43 +00:00
|
|
|
};
|
|
|
|
|
2016-09-18 13:57:22 +00:00
|
|
|
class FExposureExtractShader
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
void Bind();
|
|
|
|
|
|
|
|
FBufferedUniformSampler SceneTexture;
|
|
|
|
FBufferedUniform2f Scale;
|
|
|
|
FBufferedUniform2f Offset;
|
|
|
|
|
|
|
|
private:
|
|
|
|
FShaderProgram mShader;
|
|
|
|
};
|
|
|
|
|
|
|
|
class FExposureAverageShader
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
void Bind();
|
|
|
|
|
|
|
|
FBufferedUniformSampler ExposureTexture;
|
|
|
|
|
|
|
|
private:
|
|
|
|
FShaderProgram mShader;
|
|
|
|
};
|
|
|
|
|
|
|
|
class FExposureCombineShader
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
void Bind();
|
|
|
|
|
|
|
|
FBufferedUniformSampler ExposureTexture;
|
|
|
|
FBufferedUniform1f ExposureBase;
|
|
|
|
FBufferedUniform1f ExposureMin;
|
|
|
|
FBufferedUniform1f ExposureScale;
|
|
|
|
FBufferedUniform1f ExposureSpeed;
|
|
|
|
|
|
|
|
private:
|
|
|
|
FShaderProgram mShader;
|
|
|
|
};
|
|
|
|
|
2016-07-28 22:36:43 +00:00
|
|
|
#endif
|