diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index d84322dfda647d5ae34bbd09d8cd715ff906fbc5..7746cc3a9f104441eaa87328ff78d0c93e46caa5 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -3137,7 +3137,13 @@ static void HWR_SplitSprite(gl_vissprite_t *spr) if (!occlusion) use_linkdraw_hack = true; } - Surf.PolyColor.s.alpha = FixedMul(newalpha, Surf.PolyColor.s.alpha); + if (cv_translucency.value && newalpha < FRACUNIT) + { + // TODO: The ternary operator is a hack to make alpha values roughly match what their FF_TRANSMASK equivalent would be + // See if there's a better way of doing this + Surf.PolyColor.s.alpha = min(FixedMul(newalpha, Surf.PolyColor.s.alpha == 0xFF ? 256 : Surf.PolyColor.s.alpha), 0xFF); + blend = HWR_GetBlendModeFlag(blendmode); + } if (HWR_UseShader()) { @@ -3632,7 +3638,13 @@ static void HWR_DrawSprite(gl_vissprite_t *spr) if (!occlusion) use_linkdraw_hack = true; } - Surf.PolyColor.s.alpha = FixedMul(newalpha, Surf.PolyColor.s.alpha); + if (cv_translucency.value && newalpha < FRACUNIT) + { + // TODO: The ternary operator is a hack to make alpha values roughly match what their FF_TRANSMASK equivalent would be + // See if there's a better way of doing this + Surf.PolyColor.s.alpha = min(FixedMul(newalpha, Surf.PolyColor.s.alpha == 0xFF ? 256 : Surf.PolyColor.s.alpha), 0xFF); + blend = HWR_GetBlendModeFlag(blendmode); + } if (spr->renderflags & RF_SHADOWEFFECTS) { diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c index ce2c2c34638c2b4a412a11128ce17d200088381c..fa337bd21176e651ffd74da98d6e0fc02f40509d 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -1388,8 +1388,13 @@ boolean HWR_DrawModel(gl_vissprite_t *spr) Surf.PolyColor.s.alpha = (spr->mobj->flags2 & MF2_SHADOW) ? 0x40 : 0xff; Surf.PolyFlags = HWR_GetBlendModeFlag(blendmode); } - - Surf.PolyColor.s.alpha = FixedMul(newalpha, Surf.PolyColor.s.alpha); + + if (newalpha < FRACUNIT) + { + // TODO: The ternary operator is a hack to make alpha values roughly match what their FF_TRANSMASK equivalent would be + // See if there's a better way of doing this + Surf.PolyColor.s.alpha = min(FixedMul(newalpha, Surf.PolyColor.s.alpha == 0xFF ? 256 : Surf.PolyColor.s.alpha), 0xFF); + } // don't forget to enable the depth test because we can't do this // like before: model polygons are not sorted