1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 08:19:56 +00:00
openmw-tes3mp/files/materials/brightness_contrast_gamma.shader
mrcheko cee72d021d contrast and gamma post-processing effect added
initial values are set to approximate vanilla
2014-12-29 19:51:19 +03:00

20 lines
618 B
GLSL

#include "core.h"
#ifdef SH_FRAGMENT_SHADER
SH_BEGIN_PROGRAM
shInput(float2, UV)
shSampler2D(SceneBuffer)
shUniform(float2, contrast_invGamma) @shSharedParameter(contrast_invGamma)
SH_START_PROGRAM
{
shOutputColour(0) = shSample(SceneBuffer, UV);
// contrast
shOutputColour(0).xyz = (shOutputColour(0).xyz - float3(0.5,0.5,0.5)) * contrast_invGamma.x + float3(0.5,0.5,0.5);
shOutputColour(0).xyz = shSaturate(shOutputColour(0).xyz);
// gamma
shOutputColour(0).xyz = pow(shOutputColour(0).xyz, contrast_invGamma.yyy);
}
#endif