From 53a389aafc2d5827bcf120b8412386498bf7df89 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 31 Jan 2016 22:24:48 +0100 Subject: [PATCH] - fixed: for untextured walls, the texture must be disabled before rendering. - fixed: untextured walls should never be passed to SplitWall. - fixed: untextured walls should not be affected by dynamic lights (it's either fog boundaries or outsides of 3D fog volumes.) --- src/gl/scene/gl_walls.cpp | 10 ++++++---- src/gl/scene/gl_walls_draw.cpp | 9 +++++---- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/gl/scene/gl_walls.cpp b/src/gl/scene/gl_walls.cpp index 2e4e21e5cf..6e51c2702f 100644 --- a/src/gl/scene/gl_walls.cpp +++ b/src/gl/scene/gl_walls.cpp @@ -248,6 +248,8 @@ void GLWall::SplitWall(sector_t * frontsector, bool translucent) lights[i].colormap.CopyFrom3DLight(&lightlist[i]); } PutWall(translucent); + lights = NULL; + lightsize = 0; } @@ -543,7 +545,7 @@ void GLWall::DoTexture(int _type,seg_t * seg, int peg, // Add this wall to the render list sector_t * sec = sub? sub->sector : seg->frontsector; - if (sec->e->XFloor.lightlist.Size()==0 || gl_fixedcolormap) PutWall(false); + if (sec->e->XFloor.lightlist.Size()==0 || gl_fixedcolormap || !gltexture) PutWall(false); else SplitWall(sec, false); glseg=glsave; @@ -832,7 +834,7 @@ void GLWall::DoMidTexture(seg_t * seg, bool drawfogboundary, // Draw the stuff // // - if (realfront->e->XFloor.lightlist.Size()==0 || gl_fixedcolormap) split.PutWall(translucent); + if (realfront->e->XFloor.lightlist.Size()==0 || gl_fixedcolormap || !gltexture) split.PutWall(translucent); else split.SplitWall(realfront, translucent); t=1; @@ -846,7 +848,7 @@ void GLWall::DoMidTexture(seg_t * seg, bool drawfogboundary, // Draw the stuff without splitting // // - if (realfront->e->XFloor.lightlist.Size()==0 || gl_fixedcolormap) PutWall(translucent); + if (realfront->e->XFloor.lightlist.Size()==0 || gl_fixedcolormap || !gltexture) PutWall(translucent); else SplitWall(realfront, translucent); } alpha=1.0f; @@ -958,7 +960,7 @@ void GLWall::BuildFFBlock(seg_t * seg, F3DFloor * rover, sector_t * sec = sub? sub->sector : seg->frontsector; - if (sec->e->XFloor.lightlist.Size()==0 || gl_fixedcolormap) PutWall(translucent); + if (sec->e->XFloor.lightlist.Size()==0 || gl_fixedcolormap || !gltexture) PutWall(translucent); else SplitWall(sec, translucent); alpha=1.0f; diff --git a/src/gl/scene/gl_walls_draw.cpp b/src/gl/scene/gl_walls_draw.cpp index 4bff69238f..814bc35451 100644 --- a/src/gl/scene/gl_walls_draw.cpp +++ b/src/gl/scene/gl_walls_draw.cpp @@ -364,12 +364,12 @@ void GLWall::RenderTextured(int rflags) void GLWall::RenderTranslucentWall() { - if (gl_fixedcolormap == CM_DEFAULT && gl_lights && (gl.flags & RFL_BUFFER_STORAGE)) - { - SetupLights(); - } if (gltexture) { + if (gl_fixedcolormap == CM_DEFAULT && gl_lights && (gl.flags & RFL_BUFFER_STORAGE)) + { + SetupLights(); + } if (!gltexture->GetTransparent()) gl_RenderState.AlphaFunc(GL_GEQUAL, gl_mask_threshold); else gl_RenderState.AlphaFunc(GL_GEQUAL, 0.f); if (RenderStyle == STYLE_Add) gl_RenderState.BlendFunc(GL_SRC_ALPHA,GL_ONE); @@ -381,6 +381,7 @@ void GLWall::RenderTranslucentWall() gl_RenderState.AlphaFunc(GL_GEQUAL, 0.f); gl_SetColor(lightlevel, 0, Colormap, fabsf(alpha)); gl_SetFog(lightlevel, 0, &Colormap, RenderStyle == STYLE_Add); + gl_RenderState.EnableTexture(false); RenderWall(RWF_NOSPLIT); gl_RenderState.EnableTexture(true); }