diff --git a/src/actor.h b/src/actor.h index be3f28ec6..5474a8213 100644 --- a/src/actor.h +++ b/src/actor.h @@ -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 --- diff --git a/src/gl/scene/gl_sprite.cpp b/src/gl/scene/gl_sprite.cpp index c491bb33e..fa5b40dec 100644 --- a/src/gl/scene/gl_sprite.cpp +++ b/src/gl/scene/gl_sprite.cpp @@ -75,6 +75,7 @@ CUSTOM_CVAR(Int, gl_fuzztype, 0, CVAR_ARCHIVE) } EXTERN_CVAR (Float, transsouls) +EXTERN_CVAR (Bool, r_canontrans) extern TArray sprites; extern TArray 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) || diff --git a/src/polyrenderer/scene/poly_sprite.cpp b/src/polyrenderer/scene/poly_sprite.cpp index 2ddf46df3..fb2c4ea28 100644 --- a/src/polyrenderer/scene/poly_sprite.cpp +++ b/src/polyrenderer/scene/poly_sprite.cpp @@ -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); diff --git a/src/r_data/renderstyle.cpp b/src/r_data/renderstyle.cpp index 987de82b9..11943f46d 100644 --- a/src/r_data/renderstyle.cpp +++ b/src/r_data/renderstyle.cpp @@ -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. diff --git a/src/scripting/thingdef_data.cpp b/src/scripting/thingdef_data.cpp index f62ba0c88..d978136b8 100644 --- a/src/scripting/thingdef_data.cpp +++ b/src/scripting/thingdef_data.cpp @@ -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), diff --git a/src/swrenderer/things/r_sprite.cpp b/src/swrenderer/things/r_sprite.cpp index 889430004..c7c2898ba 100644 --- a/src/swrenderer/things/r_sprite.cpp +++ b/src/swrenderer/things/r_sprite.cpp @@ -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; diff --git a/wadsrc/static/zscript/doom/arachnotron.txt b/wadsrc/static/zscript/doom/arachnotron.txt index c7e11ab14..36bb2b38e 100644 --- a/wadsrc/static/zscript/doom/arachnotron.txt +++ b/wadsrc/static/zscript/doom/arachnotron.txt @@ -72,6 +72,7 @@ class ArachnotronPlasma : Actor Damage 5; Projectile; +RANDOMIZE + +ZDOOMTRANS RenderStyle "Add"; Alpha 0.75; SeeSound "baby/attack"; diff --git a/wadsrc/static/zscript/doom/archvile.txt b/wadsrc/static/zscript/doom/archvile.txt index 2ea153be1..8e0a98dcb 100644 --- a/wadsrc/static/zscript/doom/archvile.txt +++ b/wadsrc/static/zscript/doom/archvile.txt @@ -70,7 +70,7 @@ class ArchvileFire : Actor { Default { - +NOBLOCKMAP +NOGRAVITY + +NOBLOCKMAP +NOGRAVITY +ZDOOMTRANS RenderStyle "Add"; Alpha 1; } diff --git a/wadsrc/static/zscript/doom/bossbrain.txt b/wadsrc/static/zscript/doom/bossbrain.txt index 07f0cc946..5b87182c9 100644 --- a/wadsrc/static/zscript/doom/bossbrain.txt +++ b/wadsrc/static/zscript/doom/bossbrain.txt @@ -120,6 +120,7 @@ class SpawnFire : Actor Height 78; +NOBLOCKMAP +NOGRAVITY + +ZDOOMTRANS RenderStyle "Add"; } States diff --git a/wadsrc/static/zscript/doom/bruiser.txt b/wadsrc/static/zscript/doom/bruiser.txt index c1faa23c1..81f12db54 100644 --- a/wadsrc/static/zscript/doom/bruiser.txt +++ b/wadsrc/static/zscript/doom/bruiser.txt @@ -121,6 +121,7 @@ class BaronBall : Actor Damage 8; Projectile ; +RANDOMIZE + +ZDOOMTRANS RenderStyle "Add"; Alpha 1; SeeSound "baron/attack"; diff --git a/wadsrc/static/zscript/doom/cacodemon.txt b/wadsrc/static/zscript/doom/cacodemon.txt index b21acacd2..8cd3a5089 100644 --- a/wadsrc/static/zscript/doom/cacodemon.txt +++ b/wadsrc/static/zscript/doom/cacodemon.txt @@ -71,6 +71,7 @@ class CacodemonBall : Actor Damage 5; Projectile; +RANDOMIZE + +ZDOOMTRANS RenderStyle "Add"; Alpha 1; SeeSound "caco/attack"; diff --git a/wadsrc/static/zscript/doom/doomartifacts.txt b/wadsrc/static/zscript/doom/doomartifacts.txt index a6996cb88..bb04da93c 100644 --- a/wadsrc/static/zscript/doom/doomartifacts.txt +++ b/wadsrc/static/zscript/doom/doomartifacts.txt @@ -97,6 +97,7 @@ class BlurSphere : PowerupGiver { +COUNTITEM +VISIBILITYPULSE + +ZDOOMTRANS +INVENTORY.AUTOACTIVATE +INVENTORY.ALWAYSPICKUP +INVENTORY.BIGPOWERUP diff --git a/wadsrc/static/zscript/doom/doomimp.txt b/wadsrc/static/zscript/doom/doomimp.txt index d2b93acdd..c3a187b38 100644 --- a/wadsrc/static/zscript/doom/doomimp.txt +++ b/wadsrc/static/zscript/doom/doomimp.txt @@ -77,6 +77,7 @@ class DoomImpBall : Actor Damage 3; Projectile; +RANDOMIZE + +ZDOOMTRANS RenderStyle "Add"; Alpha 1; SeeSound "imp/attack"; diff --git a/wadsrc/static/zscript/doom/doommisc.txt b/wadsrc/static/zscript/doom/doommisc.txt index 7d4c9dec4..c6d8af717 100644 --- a/wadsrc/static/zscript/doom/doommisc.txt +++ b/wadsrc/static/zscript/doom/doommisc.txt @@ -61,6 +61,7 @@ class BulletPuff : Actor +NOGRAVITY +ALLOWPARTICLES +RANDOMIZE + +ZDOOMTRANS RenderStyle "Translucent"; Alpha 0.5; VSpeed 1; diff --git a/wadsrc/static/zscript/doom/fatso.txt b/wadsrc/static/zscript/doom/fatso.txt index e70c97924..2e6321650 100644 --- a/wadsrc/static/zscript/doom/fatso.txt +++ b/wadsrc/static/zscript/doom/fatso.txt @@ -74,6 +74,7 @@ class FatShot : Actor Damage 8; Projectile; +RANDOMIZE + +ZDOOMTRANS RenderStyle "Add"; Alpha 1; SeeSound "fatso/attack"; diff --git a/wadsrc/static/zscript/doom/lostsoul.txt b/wadsrc/static/zscript/doom/lostsoul.txt index 7d918aa10..ce7f07f51 100644 --- a/wadsrc/static/zscript/doom/lostsoul.txt +++ b/wadsrc/static/zscript/doom/lostsoul.txt @@ -15,7 +15,7 @@ class LostSoul : Actor Damage 3; PainChance 256; Monster; - +FLOAT +NOGRAVITY +MISSILEMORE +DONTFALL +NOICEDEATH; + +FLOAT +NOGRAVITY +MISSILEMORE +DONTFALL +NOICEDEATH +ZDOOMTRANS; AttackSound "skull/melee"; PainSound "skull/pain"; DeathSound "skull/death"; diff --git a/wadsrc/static/zscript/doom/revenant.txt b/wadsrc/static/zscript/doom/revenant.txt index 82d563934..c3a7c218d 100644 --- a/wadsrc/static/zscript/doom/revenant.txt +++ b/wadsrc/static/zscript/doom/revenant.txt @@ -80,6 +80,7 @@ class RevenantTracer : Actor Projectile; +SEEKERMISSILE +RANDOMIZE + +ZDOOMTRANS SeeSound "skeleton/attack"; DeathSound "skeleton/tracex"; RenderStyle "Add"; @@ -110,6 +111,7 @@ class RevenantTracerSmoke : Actor +NOBLOCKMAP +NOGRAVITY +NOTELEPORT + +ZDOOMTRANS RenderStyle "Translucent"; Alpha 0.5; } diff --git a/wadsrc/static/zscript/doom/weaponbfg.txt b/wadsrc/static/zscript/doom/weaponbfg.txt index 9bf0084b3..9da326313 100644 --- a/wadsrc/static/zscript/doom/weaponbfg.txt +++ b/wadsrc/static/zscript/doom/weaponbfg.txt @@ -142,6 +142,7 @@ class BFGBall : Actor Damage 100; Projectile; +RANDOMIZE + +ZDOOMTRANS RenderStyle "Add"; Alpha 0.75; DeathSound "weapons/bfgx"; diff --git a/wadsrc/static/zscript/doom/weaponplasma.txt b/wadsrc/static/zscript/doom/weaponplasma.txt index 945339a35..b66092b82 100644 --- a/wadsrc/static/zscript/doom/weaponplasma.txt +++ b/wadsrc/static/zscript/doom/weaponplasma.txt @@ -51,6 +51,7 @@ class PlasmaBall : Actor Damage 5; Projectile; +RANDOMIZE + +ZDOOMTRANS RenderStyle "Add"; Alpha 0.75; SeeSound "weapons/plasmaf";