Skip to content

Commit

Permalink
- add option to override renderflags +BILLBOARD[NO]FACECAMERA
Browse files Browse the repository at this point in the history
  • Loading branch information
madame-rachelle committed Dec 9, 2023
1 parent b4d5c7d commit 102c467
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/rendering/hwrenderer/scene/hw_drawlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@ void HWDrawList::SortWallIntoWall(HWDrawInfo *di, SortNode * head,SortNode * sor
//==========================================================================
EXTERN_CVAR(Int, gl_billboard_mode)
EXTERN_CVAR(Bool, gl_billboard_faces_camera)
EXTERN_CVAR(Bool, hw_force_cambbpref)
EXTERN_CVAR(Bool, gl_billboard_particles)

inline double CalcIntersectionVertex(HWSprite *s, HWWall * w2)
Expand Down Expand Up @@ -523,7 +524,8 @@ 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 && (ss->actor && !(ss->actor->renderflags2 & RF2_BILLBOARDNOFACECAMERA)))
const bool drawBillboardFacingCamera = hw_force_cambbpref ? gl_billboard_faces_camera :
(gl_billboard_faces_camera && (ss->actor && !(ss->actor->renderflags2 & RF2_BILLBOARDNOFACECAMERA)))
|| (ss->actor && ss->actor->renderflags2 & RF2_BILLBOARDFACECAMERA);

// [Nash] has +ROLLSPRITE
Expand Down
7 changes: 5 additions & 2 deletions src/rendering/hwrenderer/scene/hw_sprites.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ CVAR(Float, gl_sclipfactor, 1.8f, CVAR_ARCHIVE)
CVAR(Int, gl_particles_style, 2, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) // 0 = square, 1 = round, 2 = smooth
CVAR(Int, gl_billboard_mode, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
CVAR(Bool, gl_billboard_faces_camera, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
CVAR(Bool, hw_force_cambbpref, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
CVAR(Bool, gl_billboard_particles, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
CUSTOM_CVAR(Int, gl_fuzztype, 0, CVAR_ARCHIVE)
{
Expand Down Expand Up @@ -386,7 +387,8 @@ 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 && (actor && !(actor->renderflags2 & RF2_BILLBOARDNOFACECAMERA)))
const bool drawBillboardFacingCamera = hw_force_cambbpref ? gl_billboard_faces_camera :
(gl_billboard_faces_camera && (actor && !(actor->renderflags2 & RF2_BILLBOARDNOFACECAMERA)))
|| !!(actor && actor->renderflags2 & RF2_BILLBOARDFACECAMERA);

// [Nash] has +ROLLSPRITE
Expand Down Expand Up @@ -1139,8 +1141,9 @@ void HWSprite::Process(HWDrawInfo *di, AActor* thing, sector_t * sector, area_t

if (!gl_sprite_blend || modelframe ||
(thing->renderflags & (RF_FLATSPRITE | RF_WALLSPRITE)) ||
(hw_force_cambbpref ? gl_billboard_faces_camera :
(gl_billboard_faces_camera && !(thing->renderflags2 & RF2_BILLBOARDNOFACECAMERA)) ||
thing->renderflags2 & RF2_BILLBOARDFACECAMERA)
thing->renderflags2 & RF2_BILLBOARDFACECAMERA))
{
RenderStyle.SrcAlpha = STYLEALPHA_One;
RenderStyle.DestAlpha = STYLEALPHA_Zero;
Expand Down
1 change: 1 addition & 0 deletions wadsrc/static/menudef.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2630,6 +2630,7 @@ OptionMenu "OpenGLOptions" protected
Option "$GLPREFMNU_FUZZSTYLE", gl_fuzztype, "FuzzStyle"
Option "$GLPREFMNU_SPRBILLBOARD", gl_billboard_mode, "BillboardModes"
Option "$GLPREFMNU_SPRBILLFACECAMERA", gl_billboard_faces_camera, "OnOff"
Option "$GLPREFMNU_SPRBILLFACECAMERAFORCE", hw_force_cambbpref, "OnOff"
Option "$GLPREFMNU_PARTICLESTYLE", gl_particles_style, "Particles"
Option "$GLPREFMNU_RENDERQUALITY", gl_seamless, "Precision"
//Option "$GLPREFMNU_CORONAS", gl_coronas, "OnOff"
Expand Down

0 comments on commit 102c467

Please sign in to comment.