From d46315c44b99f07be7244da4ae01bc010b380795 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 5 Dec 2013 15:39:46 +0100 Subject: [PATCH] - some finetuning of subtractive effect. --- src/gl/scene/gl_sprite.cpp | 1 + wadsrc/static/shaders/glsl/main_foglayer.fp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gl/scene/gl_sprite.cpp b/src/gl/scene/gl_sprite.cpp index 0a672737ed..b7a48852cc 100644 --- a/src/gl/scene/gl_sprite.cpp +++ b/src/gl/scene/gl_sprite.cpp @@ -310,6 +310,7 @@ void GLSprite::Draw(int pass) gl_SetFog(foglevel, rel, &Colormap, additivefog); gl_RenderState.SetFixedColormap(CM_FOGLAYER); gl_RenderState.BlendEquation(GL_FUNC_ADD); + gl_RenderState.BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); gl_RenderState.Apply(); glBegin(GL_TRIANGLE_STRIP); diff --git a/wadsrc/static/shaders/glsl/main_foglayer.fp b/wadsrc/static/shaders/glsl/main_foglayer.fp index 5d18eeee5d..4b1bdf4181 100644 --- a/wadsrc/static/shaders/glsl/main_foglayer.fp +++ b/wadsrc/static/shaders/glsl/main_foglayer.fp @@ -54,6 +54,6 @@ void main() fogfactor = exp2 (fogparm.z * fogdist); vec4 frag = Process(vec4(1.0,1.0,1.0,1.0)); - gl_FragColor = vec4(fogcolor.rgb, (1.0 - fogfactor) * frag.a * 0.75); + gl_FragColor = vec4(fogcolor.rgb, (1.0 - fogfactor) * frag.a * 0.75 * glColor.a); }