From 227071bb9a3c6cacaed7849d6be8dc396240cb2b Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Mon, 29 Jul 2024 17:59:38 +0200 Subject: [PATCH] Don't use Soft Particles for particles at player-weapon or at least if weaponDepthHack is set. That somehow broke muzzle flash effects in Dentonmod, see https://github.com/dhewm/dhewm3-sdk/issues/36 --- neo/renderer/tr_light.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/neo/renderer/tr_light.cpp b/neo/renderer/tr_light.cpp index 523a08a2..58076c10 100644 --- a/neo/renderer/tr_light.cpp +++ b/neo/renderer/tr_light.cpp @@ -1443,7 +1443,9 @@ static void R_AddAmbientDrawsurfs( viewEntity_t *vEntity ) { float particle_radius = -1.0f; // Default = disallow softening, but allow modelDepthHack if specified in the decl. if ( r_useSoftParticles.GetBool() && r_enableDepthCapture.GetInteger() != 0 && !shader->ReceivesLighting() // don't soften surfaces that are meant to be solid - && tr.viewDef->renderView.viewID >= 0 ) // Skip during "invisible" rendering passes (e.g. lightgem) + && tr.viewDef->renderView.viewID >= 0 // Skip during "invisible" rendering passes (e.g. lightgem) + // don't apply to particles spawned at the player-weapon (like muzzle flash) + && !vEntity->weaponDepthHack ) // to fix https://github.com/dhewm/dhewm3-sdk/issues/36 { const idRenderModelPrt* prt = dynamic_cast( def->parms.hModel ); // yuck. if ( prt )