]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
add a TODO comment about sound falloff curve, needs research
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 8 Oct 2011 18:12:33 +0000 (18:12 +0000)
committerRudolf Polzer <divverent@xonotic.org>
Sat, 8 Oct 2011 18:38:31 +0000 (20:38 +0200)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11394 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=f400985e6de180cce8374bcc3eecdfa1a28844ca

snd_main.c

index 88e43d949a5a634d9a3fa722a564941204293112..d0d7cfd26603332b5dfcd59b6b0c51e6b893213b 100644 (file)
@@ -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;