diff --git a/src/playsim/actor.h b/src/playsim/actor.h index 0892baeb17..8bcc4c91d7 100644 --- a/src/playsim/actor.h +++ b/src/playsim/actor.h @@ -481,7 +481,7 @@ enum ActorRenderFlag RF_MASKROTATION = 0x00200000, // [MC] Only draw the actor when viewed from a certain angle range. RF_ABSMASKANGLE = 0x00400000, // [MC] The mask rotation does not offset by the actor's angle. RF_ABSMASKPITCH = 0x00800000, // [MC] The mask rotation does not offset by the actor's pitch. - RF_INTERPOLATEANGLES = 0x01000000, // [MC] Allow interpolation of the actor's angle, pitch and roll. + RF_INTERPOLATEANGLES = 0x01000000, // [MC] Allow interpolation of the actor's angle, pitch and roll. RF_MAYBEINVISIBLE = 0x02000000, RF_DONTINTERPOLATE = 0x04000000, // no render interpolation ever! @@ -489,13 +489,14 @@ enum ActorRenderFlag RF_ZDOOMTRANS = 0x10000000, // is not normally transparent in Vanilla Doom RF_CASTSPRITESHADOW = 0x20000000, // actor will cast a sprite shadow RF_NOINTERPOLATEVIEW = 0x40000000, // don't interpolate the view next frame if this actor is a camera. - RF_NOSPRITESHADOW = 0x80000000, // actor will not cast a sprite shadow + RF_NOSPRITESHADOW = 0x80000000, // actor will not cast a sprite shadow }; enum ActorRenderFlag2 { RF2_INVISIBLEINMIRRORS = 0x0001, // [Nash] won't render in mirrors RF2_ONLYVISIBLEINMIRRORS = 0x0002, // [Nash] only renders in mirrors + RF2_BILLBOARDFACECAMERA = 0x0004, // Sprite billboard face camera (override gl_billboard_faces_camera) }; // This translucency value produces the closest match to Heretic's TINTTAB. diff --git a/src/rendering/hwrenderer/scene/hw_drawlist.cpp b/src/rendering/hwrenderer/scene/hw_drawlist.cpp index 0607e7fe4e..2b92bd0117 100644 --- a/src/rendering/hwrenderer/scene/hw_drawlist.cpp +++ b/src/rendering/hwrenderer/scene/hw_drawlist.cpp @@ -523,7 +523,7 @@ void HWDrawList::SortSpriteIntoWall(HWDrawInfo *di, SortNode * head,SortNode * s const bool drawWithXYBillboard = ((ss->particle && gl_billboard_particles) || (!(ss->actor && ss->actor->renderflags & RF_FORCEYBILLBOARD) && (gl_billboard_mode == 1 || (ss->actor && ss->actor->renderflags & RF_FORCEXYBILLBOARD)))); - const bool drawBillboardFacingCamera = gl_billboard_faces_camera; + const bool drawBillboardFacingCamera = gl_billboard_faces_camera || (ss->actor && ss->actor->renderflags2 & RF2_BILLBOARDFACECAMERA); // [Nash] has +ROLLSPRITE const bool rotated = (ss->actor != nullptr && ss->actor->renderflags & (RF_ROLLSPRITE | RF_WALLSPRITE | RF_FLATSPRITE)); diff --git a/src/rendering/hwrenderer/scene/hw_sprites.cpp b/src/rendering/hwrenderer/scene/hw_sprites.cpp index b12005c079..175a744cfb 100644 --- a/src/rendering/hwrenderer/scene/hw_sprites.cpp +++ b/src/rendering/hwrenderer/scene/hw_sprites.cpp @@ -386,7 +386,7 @@ bool HWSprite::CalculateVertices(HWDrawInfo *di, FVector3 *v, DVector3 *vp) //&& di->mViewActor != nullptr && (gl_billboard_mode == 1 || (actor && actor->renderflags & RF_FORCEXYBILLBOARD)))); - const bool drawBillboardFacingCamera = gl_billboard_faces_camera; + const bool drawBillboardFacingCamera = gl_billboard_faces_camera || !!(actor->renderflags2 & RF2_BILLBOARDFACECAMERA); // [Nash] has +ROLLSPRITE const bool drawRollSpriteActor = (actor != nullptr && actor->renderflags & RF_ROLLSPRITE); @@ -1135,7 +1135,9 @@ void HWSprite::Process(HWDrawInfo *di, AActor* thing, sector_t * sector, area_t // This is a non-translucent sprite (i.e. STYLE_Normal or equivalent) trans = 1.f; - if (!gl_sprite_blend || modelframe || (thing->renderflags & (RF_FLATSPRITE | RF_WALLSPRITE)) || gl_billboard_faces_camera) + if (!gl_sprite_blend || modelframe || + (thing->renderflags & (RF_FLATSPRITE | RF_WALLSPRITE)) || gl_billboard_faces_camera || + thing->renderflags2 & RF2_BILLBOARDFACECAMERA) { RenderStyle.SrcAlpha = STYLEALPHA_One; RenderStyle.DestAlpha = STYLEALPHA_Zero; diff --git a/src/scripting/thingdef_data.cpp b/src/scripting/thingdef_data.cpp index 64a68d6bc3..b918c45b2e 100644 --- a/src/scripting/thingdef_data.cpp +++ b/src/scripting/thingdef_data.cpp @@ -378,6 +378,7 @@ static FFlagDef ActorFlagDefs[]= DEFINE_FLAG(RF, NOSPRITESHADOW, AActor, renderflags), DEFINE_FLAG(RF2, INVISIBLEINMIRRORS, AActor, renderflags2), DEFINE_FLAG(RF2, ONLYVISIBLEINMIRRORS, AActor, renderflags2), + DEFINE_FLAG(RF2, BILLBOARDFACECAMERA, AActor, renderflags2), // Bounce flags DEFINE_FLAG2(BOUNCE_Walls, BOUNCEONWALLS, AActor, BounceFlags),