- Added r_shadercolormaps cvar. Set it to false to disable shaders for fixed colormap effects

(e.g. invulnerability). This should only be necessary for SM1.4 cards with buggy drivers. I
  doubt the problem is very widespread. The one piece of SM1.4 hardware I obtained specifically
  for testing purposes has no problems using shaders for these effects.

SVN r3200 (trunk)
This commit is contained in:
Randy Heit 2011-05-11 04:16:45 +00:00
parent b7fadac671
commit 8ccf552d09
2 changed files with 18 additions and 3 deletions

View file

@ -113,6 +113,7 @@ CVAR (String, r_viewsize, "", CVAR_NOSET)
CVAR (Int, r_polymost, 0, 0)
CVAR (Bool, r_deathcamera, false, CVAR_ARCHIVE)
CVAR (Int, r_clearbuffer, 0, 0)
CVAR (Bool, r_shadercolormaps, true, CVAR_ARCHIVE)
fixed_t r_BaseVisibility;
fixed_t r_WallVisibility;
@ -1259,7 +1260,7 @@ void R_SetupFrame (AActor *actor)
if (player->fixedcolormap >= 0 && player->fixedcolormap < (int)SpecialColormaps.Size())
{
realfixedcolormap = &SpecialColormaps[player->fixedcolormap];
if (RenderTarget == screen && (DFrameBuffer *)screen->Accel2D)
if (RenderTarget == screen && (DFrameBuffer *)screen->Accel2D && r_shadercolormaps)
{
// Render everything fullbright. The copy to video memory will
// apply the special colormap, so it won't be restricted to the
@ -1649,6 +1650,13 @@ void R_RenderActorView (AActor *actor, bool dontmaplines)
WallMirrors.Clear ();
interpolator.RestoreInterpolations ();
R_SetupBuffer ();
// If we don't want shadered colormaps, NULL it now so that the
// copy to the screen does not use a special colormap shader.
if (!r_shadercolormaps)
{
realfixedcolormap = NULL;
}
}
//==========================================================================

View file

@ -68,7 +68,7 @@ extern fixed_t globaluclip, globaldclip;
EXTERN_CVAR (Bool, st_scale)
CVAR (Int, r_drawfuzz, 1, CVAR_ARCHIVE)
EXTERN_CVAR(Bool, r_shadercolormaps)
//
// Sprite rotation 0 is facing the viewer,
@ -2288,7 +2288,7 @@ void R_DrawPSprite (pspdef_t* psp, int pspnum, AActor *owner, fixed_t sx, fixed_
// If not, then don't bother trying to identify it for
// hardware accelerated drawing.
if (vis->colormap < SpecialColormaps[0].Colormap ||
vis->colormap >= SpecialColormaps[SpecialColormaps.Size()].Colormap)
vis->colormap > SpecialColormaps.Last().Colormap)
{
noaccel = true;
}
@ -2301,6 +2301,13 @@ void R_DrawPSprite (pspdef_t* psp, int pspnum, AActor *owner, fixed_t sx, fixed_
}
}
}
// If we're drawing with a special colormap, but shaders for them are disabled, do
// not accelerate.
if (!r_shadercolormaps && (vis->colormap >= SpecialColormaps[0].Colormap &&
vis->colormap <= SpecialColormaps.Last().Colormap))
{
noaccel = true;
}
// If the main colormap has fixed lights, and this sprite is being drawn with that
// colormap, disable acceleration so that the lights can remain fixed.
if (!noaccel &&