- Added 'canonical transparency' cvar r_canontrans - this simply turns off transparency for Doom objects that were marked as transparent sometime in ZDoom's development cycle
This commit is contained in:
parent
d2f4dd41f8
commit
813b321c45
19 changed files with 33 additions and 3 deletions
|
|
@ -402,6 +402,7 @@ enum ActorFlag8
|
|||
{
|
||||
MF8_FRIGHTENING = 0x00000001, // for those moments when halloween just won't do
|
||||
MF8_INSCROLLSEC = 0x00000002, // actor is partially inside a scrolling sector
|
||||
MF8_ZDOOMTRANS = 0x00000004, // is not normally transparent in Vanilla Doom
|
||||
};
|
||||
|
||||
// --- mobj.renderflags ---
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@ CUSTOM_CVAR(Int, gl_fuzztype, 0, CVAR_ARCHIVE)
|
|||
}
|
||||
|
||||
EXTERN_CVAR (Float, transsouls)
|
||||
EXTERN_CVAR (Bool, r_canontrans)
|
||||
|
||||
extern TArray<spritedef_t> sprites;
|
||||
extern TArray<spriteframe_t> SpriteFrames;
|
||||
|
|
@ -992,6 +993,13 @@ void GLSprite::Process(AActor* thing, sector_t * sector, int thruportal)
|
|||
{
|
||||
trans = 1.f;
|
||||
}
|
||||
if ((thing->flags8 & MF8_ZDOOMTRANS) && r_canontrans)
|
||||
{ // [SP] "canonical transparency" - with the flip of a CVar, disable transparency for Doom objects
|
||||
trans = 1.f;
|
||||
RenderStyle.BlendOp = STYLEOP_Add;
|
||||
RenderStyle.SrcAlpha = STYLEALPHA_One;
|
||||
RenderStyle.DestAlpha = STYLEALPHA_Zero;
|
||||
}
|
||||
|
||||
if (trans >= 1.f - FLT_EPSILON && RenderStyle.BlendOp != STYLEOP_Shadow && (
|
||||
(RenderStyle.SrcAlpha == STYLEALPHA_One && RenderStyle.DestAlpha == STYLEALPHA_Zero) ||
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
|
||||
EXTERN_CVAR(Float, transsouls)
|
||||
EXTERN_CVAR(Int, r_drawfuzz)
|
||||
EXTERN_CVAR (Bool, r_canontrans)
|
||||
|
||||
bool RenderPolySprite::GetLine(AActor *thing, DVector2 &left, DVector2 &right)
|
||||
{
|
||||
|
|
@ -145,7 +146,10 @@ void RenderPolySprite::Render(const TriMatrix &worldToClip, const PolyClipPlane
|
|||
args.SetStencilTestValue(stencilValue);
|
||||
args.SetWriteStencil(true, stencilValue);
|
||||
args.SetClipPlane(clipPlane);
|
||||
args.SetStyle(thing->RenderStyle, thing->Alpha, thing->fillcolor, thing->Translation, tex, fullbrightSprite);
|
||||
if ((thing->flags8 & MF8_ZDOOMTRANS) && r_canontrans)
|
||||
args.SetStyle(LegacyRenderStyles[STYLE_Normal], 1.0f, thing->fillcolor, thing->Translation, tex, fullbrightSprite);
|
||||
else
|
||||
args.SetStyle(thing->RenderStyle, thing->Alpha, thing->fillcolor, thing->Translation, tex, fullbrightSprite);
|
||||
args.SetSubsectorDepthTest(true);
|
||||
args.SetWriteSubsectorDepth(false);
|
||||
args.SetWriteStencil(false);
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@
|
|||
#include "serializer.h"
|
||||
|
||||
CVAR (Bool, r_drawtrans, true, 0)
|
||||
CVAR (Bool, r_canontrans, false, CVAR_ARCHIVE)
|
||||
CVAR (Int, r_drawfuzz, 1, CVAR_ARCHIVE)
|
||||
|
||||
// Convert legacy render styles to flexible render styles.
|
||||
|
|
|
|||
|
|
@ -325,6 +325,7 @@ static FFlagDef ActorFlagDefs[]=
|
|||
DEFINE_FLAG(MF7, SPRITEFLIP, AActor, flags7),
|
||||
|
||||
DEFINE_FLAG(MF8, FRIGHTENING, AActor, flags8),
|
||||
DEFINE_FLAG(MF8, ZDOOMTRANS, AActor, flags8),
|
||||
|
||||
// Effect flags
|
||||
DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects),
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@
|
|||
|
||||
EXTERN_CVAR(Bool, r_fullbrightignoresectorcolor)
|
||||
EXTERN_CVAR(Bool, gl_light_sprites)
|
||||
EXTERN_CVAR (Bool, r_canontrans)
|
||||
|
||||
namespace swrenderer
|
||||
{
|
||||
|
|
@ -212,6 +213,8 @@ namespace swrenderer
|
|||
if (thing->flags5 & MF5_BRIGHT)
|
||||
vis->renderflags |= RF_FULLBRIGHT; // kg3D
|
||||
vis->RenderStyle = thing->RenderStyle;
|
||||
if ((thing->flags8 & MF8_ZDOOMTRANS) && r_canontrans)
|
||||
vis->RenderStyle = LegacyRenderStyles[STYLE_Normal];
|
||||
vis->FillColor = thing->fillcolor;
|
||||
vis->Translation = thing->Translation; // [RH] thing translation table
|
||||
vis->FakeFlatStat = fakeside;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue