mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-24 13:01:47 +00:00
- fixed: non-tiled mid textures on a fog boundary require some special clamping to be performed in the shader.
This commit is contained in:
parent
da87a34a6f
commit
4682736585
4 changed files with 34 additions and 3 deletions
|
@ -177,6 +177,11 @@ public:
|
|||
mTextureMode = mode;
|
||||
}
|
||||
|
||||
int GetTextureMode()
|
||||
{
|
||||
return mTextureMode;
|
||||
}
|
||||
|
||||
void EnableTexture(bool on)
|
||||
{
|
||||
mTextureEnabled = on;
|
||||
|
|
|
@ -338,10 +338,18 @@ void GLWall::RenderTranslucentWall()
|
|||
gl_RenderState.EnableTexture(false);
|
||||
extra = 0;
|
||||
}
|
||||
int tmode = gl_RenderState.GetTextureMode();
|
||||
|
||||
gl_SetColor(lightlevel, extra, Colormap, fabsf(alpha));
|
||||
if (type!=RENDERWALL_M2SNF) gl_SetFog(lightlevel, extra, &Colormap, isadditive);
|
||||
else gl_SetFog(255, 0, NULL, false);
|
||||
else
|
||||
{
|
||||
if (flags & GLT_CLAMPY)
|
||||
{
|
||||
if (tmode == TM_MODULATE) gl_RenderState.SetTextureMode(TM_CLAMPY);
|
||||
}
|
||||
gl_SetFog(255, 0, NULL, false);
|
||||
}
|
||||
|
||||
RenderWall(RWF_TEXTURED|RWF_NOSPLIT);
|
||||
|
||||
|
@ -353,6 +361,7 @@ void GLWall::RenderTranslucentWall()
|
|||
gl_RenderState.EnableTexture(true);
|
||||
}
|
||||
gl_RenderState.EnableGlow(false);
|
||||
gl_RenderState.SetTextureMode(tmode);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
@ -363,6 +372,7 @@ void GLWall::RenderTranslucentWall()
|
|||
void GLWall::Draw(int pass)
|
||||
{
|
||||
int rel;
|
||||
int tmode;
|
||||
|
||||
#ifdef _DEBUG
|
||||
if (seg->linedef-lines==879)
|
||||
|
@ -384,13 +394,21 @@ void GLWall::Draw(int pass)
|
|||
case GLPASS_PLAIN:
|
||||
rel = rellight + getExtraLight();
|
||||
gl_SetColor(lightlevel, rel, Colormap,1.0f);
|
||||
tmode = gl_RenderState.GetTextureMode();
|
||||
if (type!=RENDERWALL_M2SNF) gl_SetFog(lightlevel, rel, &Colormap, false);
|
||||
else gl_SetFog(255, 0, NULL, false);
|
||||
|
||||
else
|
||||
{
|
||||
if (flags & GLT_CLAMPY)
|
||||
{
|
||||
if (tmode == TM_MODULATE) gl_RenderState.SetTextureMode(TM_CLAMPY);
|
||||
}
|
||||
gl_SetFog(255, 0, NULL, false);
|
||||
}
|
||||
gl_RenderState.EnableGlow(!!(flags & GLWF_GLOW));
|
||||
gl_RenderState.SetMaterial(gltexture, flags & 3, false, -1, false);
|
||||
RenderWall(RWF_TEXTURED|RWF_GLOW);
|
||||
gl_RenderState.EnableGlow(false);
|
||||
gl_RenderState.SetTextureMode(tmode);
|
||||
break;
|
||||
|
||||
case GLPASS_TRANSLUCENT:
|
||||
|
|
|
@ -20,6 +20,7 @@ enum TexMode
|
|||
TM_OPAQUE, // (r, g, b, 1)
|
||||
TM_INVERSE, // (1-r, 1-g, 1-b, a)
|
||||
TM_REDTOALPHA, // (1, 1, 1, r)
|
||||
TM_CLAMPY, // (r, g, b, (t >= 0.0 && t <= 1.0)? a:0)
|
||||
};
|
||||
|
||||
struct RenderContext
|
||||
|
|
|
@ -75,6 +75,13 @@ vec4 getTexel(vec2 st)
|
|||
case 4: // TM_REDTOALPHA
|
||||
texel = vec4(1.0, 1.0, 1.0, texel.r);
|
||||
break;
|
||||
|
||||
case 5: // TM_CLAMPY
|
||||
if (st.t < 0.0 || st.t > 1.0)
|
||||
{
|
||||
texel.a = 0.0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
texel *= uObjectColor;
|
||||
|
||||
|
|
Loading…
Reference in a new issue