- 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.)
This commit is contained in:
Christoph Oelckers 2016-01-31 22:24:48 +01:00
parent 9ce6a7932c
commit 53a389aafc
2 changed files with 11 additions and 8 deletions

View file

@ -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;

View file

@ -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);
}