mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 15:21:51 +00:00
- fix for rendering a brightmapped 2D texture with ColorIsFixed render style.
This must disable the brightmap.
This commit is contained in:
parent
1baf3ccbf6
commit
2b5019ea6e
3 changed files with 20 additions and 0 deletions
|
@ -767,6 +767,7 @@ void FGLRenderer::Draw2D(F2DDrawer *drawer)
|
||||||
gl_GetRenderStyle(cmd.mRenderStyle, false, false, &tm, &sb, &db, &be);
|
gl_GetRenderStyle(cmd.mRenderStyle, false, false, &tm, &sb, &db, &be);
|
||||||
gl_RenderState.BlendEquation(be);
|
gl_RenderState.BlendEquation(be);
|
||||||
gl_RenderState.BlendFunc(sb, db);
|
gl_RenderState.BlendFunc(sb, db);
|
||||||
|
gl_RenderState.EnableBrightmap(!(cmd.mRenderStyle.Flags & STYLEF_ColorIsFixed));
|
||||||
|
|
||||||
// Rather than adding remapping code, let's enforce that the constants here are equal.
|
// Rather than adding remapping code, let's enforce that the constants here are equal.
|
||||||
static_assert(int(F2DDrawer::DTM_Normal) == int(TM_MODULATE), "DTM_Normal != TM_MODULATE");
|
static_assert(int(F2DDrawer::DTM_Normal) == int(TM_MODULATE), "DTM_Normal != TM_MODULATE");
|
||||||
|
@ -878,6 +879,7 @@ void FGLRenderer::Draw2D(F2DDrawer *drawer)
|
||||||
|
|
||||||
gl_RenderState.SetVertexBuffer(GLRenderer->mVBO);
|
gl_RenderState.SetVertexBuffer(GLRenderer->mVBO);
|
||||||
gl_RenderState.EnableTexture(true);
|
gl_RenderState.EnableTexture(true);
|
||||||
|
gl_RenderState.EnableBrightmap(true);
|
||||||
gl_RenderState.SetTextureMode(TM_MODULATE);
|
gl_RenderState.SetTextureMode(TM_MODULATE);
|
||||||
gl_RenderState.SetFixedColormap(CM_DEFAULT);
|
gl_RenderState.SetFixedColormap(CM_DEFAULT);
|
||||||
gl_RenderState.ResetColor();
|
gl_RenderState.ResetColor();
|
||||||
|
|
|
@ -212,6 +212,22 @@ WeaponLighting GetWeaponLighting(sector_t *viewsector, const DVector3 &pos, int
|
||||||
return l;
|
return l;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WeaponLighting::SetBright()
|
||||||
|
{
|
||||||
|
if (!isbelow)
|
||||||
|
{
|
||||||
|
cm.MakeWhite();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// under water areas keep most of their color for fullbright objects
|
||||||
|
cm.LightColor.r = (3 * cm.LightColor.r + 0xff) / 4;
|
||||||
|
cm.LightColor.g = (3 * cm.LightColor.g + 0xff) / 4;
|
||||||
|
cm.LightColor.b = (3 * cm.LightColor.b + 0xff) / 4;
|
||||||
|
}
|
||||||
|
lightlevel = 255;
|
||||||
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
//
|
//
|
||||||
// Render Style
|
// Render Style
|
||||||
|
|
|
@ -19,6 +19,8 @@ struct WeaponLighting
|
||||||
FColormap cm;
|
FColormap cm;
|
||||||
int lightlevel;
|
int lightlevel;
|
||||||
bool isbelow;
|
bool isbelow;
|
||||||
|
|
||||||
|
void SetBright();
|
||||||
};
|
};
|
||||||
|
|
||||||
struct WeaponRenderStyle
|
struct WeaponRenderStyle
|
||||||
|
|
Loading…
Reference in a new issue