From 7de242930a81c959c5812f0c77bdd29d713d2171 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 30 Jul 2016 15:30:35 +0300 Subject: [PATCH] Removed obsolete gamma correct shader used on macOS only --- src/gl/renderer/gl_renderstate.h | 1 - src/gl/shaders/gl_shader.cpp | 1 - wadsrc/static/shaders/glsl/gammacorrection.fp | 30 ------------------- 3 files changed, 32 deletions(-) delete mode 100644 wadsrc/static/shaders/glsl/gammacorrection.fp diff --git a/src/gl/renderer/gl_renderstate.h b/src/gl/renderer/gl_renderstate.h index 0172488eb..2ad611ab2 100644 --- a/src/gl/renderer/gl_renderstate.h +++ b/src/gl/renderer/gl_renderstate.h @@ -37,7 +37,6 @@ enum EEffect EFF_SPHEREMAP, EFF_BURN, EFF_STENCIL, - EFF_GAMMACORRECTION, MAX_EFFECTS }; diff --git a/src/gl/shaders/gl_shader.cpp b/src/gl/shaders/gl_shader.cpp index b5fd1dbbd..f2b4c7ebd 100644 --- a/src/gl/shaders/gl_shader.cpp +++ b/src/gl/shaders/gl_shader.cpp @@ -395,7 +395,6 @@ static const FEffectShader effectshaders[]= { "spheremap", "shaders/glsl/main.vp", "shaders/glsl/main.fp", "shaders/glsl/func_normal.fp", "#define SPHEREMAP\n#define NO_ALPHATEST\n" }, { "burn", "shaders/glsl/main.vp", "shaders/glsl/burn.fp", NULL, "#define SIMPLE\n#define NO_ALPHATEST\n" }, { "stencil", "shaders/glsl/main.vp", "shaders/glsl/stencil.fp", NULL, "#define SIMPLE\n#define NO_ALPHATEST\n" }, - { "gammacorrection", "shaders/glsl/main.vp", "shaders/glsl/gammacorrection.fp", NULL, "#define SIMPLE\n" }, }; diff --git a/wadsrc/static/shaders/glsl/gammacorrection.fp b/wadsrc/static/shaders/glsl/gammacorrection.fp deleted file mode 100644 index fe40ac680..000000000 --- a/wadsrc/static/shaders/glsl/gammacorrection.fp +++ /dev/null @@ -1,30 +0,0 @@ -uniform sampler2D tex; - -in vec4 vTexCoord; -in vec4 vColor; - -out vec4 FragColor; - -void main() -{ - vec3 color = texture(tex, vTexCoord.st).rgb; - -// /* DEBUG */ if (vTexCoord.x > 0.5) - { - // Apply contrast - float contrast = clamp(vColor.y, 0.1, 3.0); - color = color.rgb * contrast - (contrast - 1.0) * 0.5; - - // Apply gamma - float gamma = clamp(vColor.x, 0.1, 4.0); - color = sign(color) * pow(abs(color), vec3(1.0 / gamma)); - - // Apply brightness - float brightness = clamp(vColor.z, -0.8, 0.8); - color += brightness * 0.5; - - color = clamp(color, 0.0, 1.0); - } - - FragColor = vec4(color, 1.0); -}