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
This commit is contained in:
Daniel Gibson 2024-07-29 17:59:38 +02:00
parent b0d7c12404
commit 227071bb9a

View file

@ -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. float particle_radius = -1.0f; // Default = disallow softening, but allow modelDepthHack if specified in the decl.
if ( r_useSoftParticles.GetBool() && r_enableDepthCapture.GetInteger() != 0 if ( r_useSoftParticles.GetBool() && r_enableDepthCapture.GetInteger() != 0
&& !shader->ReceivesLighting() // don't soften surfaces that are meant to be solid && !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<const idRenderModelPrt*>( def->parms.hModel ); // yuck. const idRenderModelPrt* prt = dynamic_cast<const idRenderModelPrt*>( def->parms.hModel ); // yuck.
if ( prt ) if ( prt )