summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorJames Cook <james@cookmd.com>2009-12-30 16:47:25 -0800
committerJames Cook <james@cookmd.com>2009-12-30 16:47:25 -0800
commit8dec87c2ecbf2fe3d3c48d83722d5ee0acc8f53f (patch)
treefe800b53db4774a958b09d087d7d9da6073df7a8 /indra/newview
parentbaa79ad5eeacebb8e32b4852b9c10da462014e94 (diff)
EXT-1399 Restore some wind noise when standing still, but drop volume
Make wind volume configurable via setting AudioLevelWind, currently set to 0.5. Changing this to 1.0 will restore the viewer 1.23 behavior Reviewed with Leyla.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/app_settings/settings.xml11
-rw-r--r--indra/newview/llvieweraudio.cpp24
2 files changed, 29 insertions, 6 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 55db13e44a..e24e1a8605 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -265,6 +265,17 @@
<key>Value</key>
<real>0.5</real>
</map>
+ <key>AudioLevelWind</key>
+ <map>
+ <key>Comment</key>
+ <string>Audio level of wind noise when standing still</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>F32</string>
+ <key>Value</key>
+ <real>0.5</real>
+ </map>
<key>AudioSteamingMedia</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp
index e7f904023a..38103f9e41 100644
--- a/indra/newview/llvieweraudio.cpp
+++ b/indra/newview/llvieweraudio.cpp
@@ -211,19 +211,31 @@ void audio_update_wind(bool force_update)
//
if (force_update || (last_camera_water_height * camera_water_height) < 0.f)
{
+ static LLUICachedControl<F32> rolloff("AudioLevelRolloff", 1.0f);
if (camera_water_height < 0.f)
{
- gAudiop->setRolloffFactor(gSavedSettings.getF32("AudioLevelRolloff") * LL_ROLLOFF_MULTIPLIER_UNDER_WATER);
+ gAudiop->setRolloffFactor(rolloff * LL_ROLLOFF_MULTIPLIER_UNDER_WATER);
}
else
{
- gAudiop->setRolloffFactor(gSavedSettings.getF32("AudioLevelRolloff"));
+ gAudiop->setRolloffFactor(rolloff);
}
}
- // this line rotates the wind vector to be listener (agent) relative
- // Only use the agent's motion to compute wind noise, otherwise the world
- // feels desolate on login when you are standing still.
- gRelativeWindVec = gAgent.getFrameAgent().rotateToLocal( -gAgent.getVelocity() );
+
+ // Scale down the contribution of weather-simulation wind to the
+ // ambient wind noise. Wind velocity averages 3.5 m/s, with gusts to 7 m/s
+ // whereas steady-state avatar walk velocity is only 3.2 m/s.
+ // Without this the world feels desolate on first login when you are
+ // standing still.
+ static LLUICachedControl<F32> wind_level("AudioLevelWind", 0.5f);
+ LLVector3 scaled_wind_vec = gWindVec * wind_level;
+
+ // Mix in the avatar's motion, subtract because when you walk north,
+ // the apparent wind moves south.
+ LLVector3 final_wind_vec = scaled_wind_vec - gAgent.getVelocity();
+
+ // rotate the wind vector to be listener (agent) relative
+ gRelativeWindVec = gAgent.getFrameAgent().rotateToLocal( final_wind_vec );
// don't use the setter setMaxWindGain() because we don't
// want to screw up the fade-in on startup by setting actual source gain