From: divverent Date: Sat, 8 Oct 2011 18:12:33 +0000 (+0000) Subject: add a TODO comment about sound falloff curve, needs research X-Git-Tag: xonotic-v0.6.0~285 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=da1547ba8b543e3b1948b46cfbdf4dfa4d750572;p=xonotic%2Fdarkplaces.git add a TODO comment about sound falloff curve, needs research git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11394 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=f400985e6de180cce8374bcc3eecdfa1a28844ca --- diff --git a/snd_main.c b/snd_main.c index 88e43d94..d0d7cfd2 100644 --- a/snd_main.c +++ b/snd_main.c @@ -1450,7 +1450,13 @@ void SND_Spatialize_WithSfx(channel_t *ch, qboolean isstatic, sfx_t *sfx) // calculate stereo seperation and distance attenuation VectorSubtract(listener_origin, ch->origin, source_vec); dist = VectorLength(source_vec); - intensity = mastervol * (1.0f - dist * ch->distfade); + f = dist * ch->distfade; + + // TODO falloff formulas + f = (1.0 - f); // Quake + //f = (1.0 - f) / (1.0 + f * f); // same as rtlights use + + intensity = mastervol * f; if (intensity > 0) { qboolean occluded = false;