mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 23:01:50 +00:00
- 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;
|
||||
|
|
|
@ -72,6 +72,7 @@ class ArachnotronPlasma : Actor
|
|||
Damage 5;
|
||||
Projectile;
|
||||
+RANDOMIZE
|
||||
+ZDOOMTRANS
|
||||
RenderStyle "Add";
|
||||
Alpha 0.75;
|
||||
SeeSound "baby/attack";
|
||||
|
|
|
@ -70,7 +70,7 @@ class ArchvileFire : Actor
|
|||
{
|
||||
Default
|
||||
{
|
||||
+NOBLOCKMAP +NOGRAVITY
|
||||
+NOBLOCKMAP +NOGRAVITY +ZDOOMTRANS
|
||||
RenderStyle "Add";
|
||||
Alpha 1;
|
||||
}
|
||||
|
|
|
@ -120,6 +120,7 @@ class SpawnFire : Actor
|
|||
Height 78;
|
||||
+NOBLOCKMAP
|
||||
+NOGRAVITY
|
||||
+ZDOOMTRANS
|
||||
RenderStyle "Add";
|
||||
}
|
||||
States
|
||||
|
|
|
@ -121,6 +121,7 @@ class BaronBall : Actor
|
|||
Damage 8;
|
||||
Projectile ;
|
||||
+RANDOMIZE
|
||||
+ZDOOMTRANS
|
||||
RenderStyle "Add";
|
||||
Alpha 1;
|
||||
SeeSound "baron/attack";
|
||||
|
|
|
@ -71,6 +71,7 @@ class CacodemonBall : Actor
|
|||
Damage 5;
|
||||
Projectile;
|
||||
+RANDOMIZE
|
||||
+ZDOOMTRANS
|
||||
RenderStyle "Add";
|
||||
Alpha 1;
|
||||
SeeSound "caco/attack";
|
||||
|
|
|
@ -97,6 +97,7 @@ class BlurSphere : PowerupGiver
|
|||
{
|
||||
+COUNTITEM
|
||||
+VISIBILITYPULSE
|
||||
+ZDOOMTRANS
|
||||
+INVENTORY.AUTOACTIVATE
|
||||
+INVENTORY.ALWAYSPICKUP
|
||||
+INVENTORY.BIGPOWERUP
|
||||
|
|
|
@ -77,6 +77,7 @@ class DoomImpBall : Actor
|
|||
Damage 3;
|
||||
Projectile;
|
||||
+RANDOMIZE
|
||||
+ZDOOMTRANS
|
||||
RenderStyle "Add";
|
||||
Alpha 1;
|
||||
SeeSound "imp/attack";
|
||||
|
|
|
@ -61,6 +61,7 @@ class BulletPuff : Actor
|
|||
+NOGRAVITY
|
||||
+ALLOWPARTICLES
|
||||
+RANDOMIZE
|
||||
+ZDOOMTRANS
|
||||
RenderStyle "Translucent";
|
||||
Alpha 0.5;
|
||||
VSpeed 1;
|
||||
|
|
|
@ -74,6 +74,7 @@ class FatShot : Actor
|
|||
Damage 8;
|
||||
Projectile;
|
||||
+RANDOMIZE
|
||||
+ZDOOMTRANS
|
||||
RenderStyle "Add";
|
||||
Alpha 1;
|
||||
SeeSound "fatso/attack";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -142,6 +142,7 @@ class BFGBall : Actor
|
|||
Damage 100;
|
||||
Projectile;
|
||||
+RANDOMIZE
|
||||
+ZDOOMTRANS
|
||||
RenderStyle "Add";
|
||||
Alpha 0.75;
|
||||
DeathSound "weapons/bfgx";
|
||||
|
|
|
@ -51,6 +51,7 @@ class PlasmaBall : Actor
|
|||
Damage 5;
|
||||
Projectile;
|
||||
+RANDOMIZE
|
||||
+ZDOOMTRANS
|
||||
RenderStyle "Add";
|
||||
Alpha 0.75;
|
||||
SeeSound "weapons/plasmaf";
|
||||
|
|
Loading…
Reference in a new issue