From 723052cfa15c9a8292513dfb9662a592504d9050 Mon Sep 17 00:00:00 2001 From: Brad Harding Date: Thu, 14 Oct 2021 18:01:50 +1100 Subject: [PATCH] Cast lighter shadows for translucent things --- releasenotes.md | 1 + src/info.c | 2 +- src/r_things.c | 14 ++++++++++++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/releasenotes.md b/releasenotes.md index e4abe0b526..4ace48120f 100644 --- a/releasenotes.md +++ b/releasenotes.md @@ -38,6 +38,7 @@ * Dithered lighting is now cast on *BOOM*-compatible translucent wall textures. * Things on scrolling floors will no longer continue to move while the menu is open. * When the player drops down from a great height, their weapon will no longer move too far downwards when the `weaponbounce` CVAR is `on`. +* Translucent things now cast more translucent shadows. ![](https://github.com/bradharding/www.doomretro.com/raw/master/wiki/bigdivider.png) diff --git a/src/info.c b/src/info.c index 5a716cf849..8f217c60fe 100644 --- a/src/info.c +++ b/src/info.c @@ -2649,7 +2649,7 @@ mobjinfo_t mobjinfo[] = /* damage */ 0, /* activesound */ sfx_none, /* flags */ (MF_SPECIAL | MF_COUNTITEM), - /* flags2 */ (MF2_CASTSHADOW | MF2_TRANSLUCENT_BLUE_25 | MF2_FLOATBOB), + /* flags2 */ (MF2_CASTSHADOW | MF2_TRANSLUCENT_33 | MF2_FLOATBOB), /* flags3 */ 0, /* raisestate */ S_NULL, /* frames */ 4, diff --git a/src/r_things.c b/src/r_things.c index 86104691f4..a3886622ed 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -499,8 +499,18 @@ static void R_DrawVisSpriteWithShadow(const vissprite_t *vis) dc_colormap[0] = vis->colormap; dc_nextcolormap[0] = vis->nextcolormap; dc_black = dc_colormap[0][nearestblack]; - dc_black33 = &tinttab33[dc_black << 8]; - dc_black40 = &tinttab40[dc_black << 8]; + + if ((mobj->flags2 & MF2_TRANSLUCENT_33) && r_translucency) + { + dc_black33 = &tinttab10[dc_black << 8]; + dc_black40 = &tinttab25[dc_black << 8]; + } + else + { + dc_black33 = &tinttab33[dc_black << 8]; + dc_black40 = &tinttab40[dc_black << 8]; + } + dc_iscale = FixedDiv(FRACUNIT, spryscale); dc_texturemid = vis->texturemid;