From da1547ba8b543e3b1948b46cfbdf4dfa4d750572 Mon Sep 17 00:00:00 2001 From: divverent Date: Sat, 8 Oct 2011 18:12:33 +0000 Subject: [PATCH] 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 --- snd_main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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; -- 2.39.2