From 506798f134c857557e5cd15b093a2976490ba3b2 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 11 May 2014 23:12:28 +0200 Subject: [PATCH] allow brightmaps and fullbright objects in fog. The reasons why they were disabled no longer exist. --- src/gl/scene/gl_flats.cpp | 2 -- src/gl/scene/gl_scene.cpp | 3 --- src/gl/scene/gl_walls_draw.cpp | 2 -- src/gl/shaders/gl_shader.cpp | 6 ++---- 4 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/gl/scene/gl_flats.cpp b/src/gl/scene/gl_flats.cpp index b5a5fc5c6..383ee1574 100644 --- a/src/gl/scene/gl_flats.cpp +++ b/src/gl/scene/gl_flats.cpp @@ -471,11 +471,9 @@ void GLFlat::Draw(int pass) } else { - if (foggy) gl_RenderState.EnableBrightmap(false); gltexture->Bind(); bool pushed = gl_SetPlaneTextureRotation(&plane, gltexture); DrawSubsectors(pass, true); - gl_RenderState.EnableBrightmap(true); if (pushed) { glPopMatrix(); diff --git a/src/gl/scene/gl_scene.cpp b/src/gl/scene/gl_scene.cpp index 4b47abb1f..d32432a28 100644 --- a/src/gl/scene/gl_scene.cpp +++ b/src/gl/scene/gl_scene.cpp @@ -405,7 +405,6 @@ void FGLRenderer::RenderScene(int recursion) gl_RenderState.EnableBrightmap(gl_fixedcolormap == CM_DEFAULT); gl_drawinfo->drawlists[GLDL_PLAIN].Sort(); gl_drawinfo->drawlists[GLDL_PLAIN].Draw(pass); - gl_RenderState.EnableBrightmap(false); gl_drawinfo->drawlists[GLDL_FOG].Sort(); gl_drawinfo->drawlists[GLDL_FOG].Draw(pass); gl_drawinfo->drawlists[GLDL_LIGHTFOG].Sort(); @@ -422,10 +421,8 @@ void FGLRenderer::RenderScene(int recursion) } if (pass == GLPASS_BASE) pass = GLPASS_BASE_MASKED; gl_RenderState.AlphaFunc(GL_GEQUAL,gl_mask_threshold); - gl_RenderState.EnableBrightmap(true); gl_drawinfo->drawlists[GLDL_MASKED].Sort(); gl_drawinfo->drawlists[GLDL_MASKED].Draw(pass); - gl_RenderState.EnableBrightmap(false); gl_drawinfo->drawlists[GLDL_FOGMASKED].Sort(); gl_drawinfo->drawlists[GLDL_FOGMASKED].Draw(pass); gl_drawinfo->drawlists[GLDL_LIGHTFOGMASKED].Sort(); diff --git a/src/gl/scene/gl_walls_draw.cpp b/src/gl/scene/gl_walls_draw.cpp index 937549195..d3574ebe9 100644 --- a/src/gl/scene/gl_walls_draw.cpp +++ b/src/gl/scene/gl_walls_draw.cpp @@ -461,7 +461,6 @@ void GLWall::RenderTranslucentWall() int extra; if (gltexture) { - if (flags&GLWF_FOGGY) gl_RenderState.EnableBrightmap(false); gl_RenderState.EnableGlow(!!(flags & GLWF_GLOW)); gltexture->Bind(flags, 0); extra = getExtraLight(); @@ -486,7 +485,6 @@ void GLWall::RenderTranslucentWall() { gl_RenderState.EnableTexture(true); } - gl_RenderState.EnableBrightmap(true); gl_RenderState.EnableGlow(false); } diff --git a/src/gl/shaders/gl_shader.cpp b/src/gl/shaders/gl_shader.cpp index 768d3ad53..a132e65dd 100644 --- a/src/gl/shaders/gl_shader.cpp +++ b/src/gl/shaders/gl_shader.cpp @@ -393,10 +393,9 @@ FShader *FShaderContainer::Bind(int cm, bool glowing, float Speed, bool lights) glUniform3fv(sh->colormaprange_index, 1, m); } } - /* else { - bool desat = cm>=CM_DESAT1 && cm<=CM_DESAT31; + bool desat = false;// cm >= CM_DESAT1 && cm <= CM_DESAT31; sh = shader[glowing + 2*desat + 4*lights + (glset.lightmode & 8)]; // [BB] If there was a problem when loading the shader, sh is NULL here. if( sh ) @@ -404,11 +403,10 @@ FShader *FShaderContainer::Bind(int cm, bool glowing, float Speed, bool lights) sh->Bind(Speed); if (desat) { - glUniform1f(sh->desaturation_index, 1.f-float(cm-CM_DESAT0)/(CM_DESAT31-CM_DESAT0)); + //glUniform1f(sh->desaturation_index, 1.f-float(cm-CM_DESAT0)/(CM_DESAT31-CM_DESAT0)); } } } - */ return sh; }