ValveSoftware / steam-audio

Steam Audio
https://valvesoftware.github.io/steam-audio/
Apache License 2.0
2.32k stars 163 forks source link

Pathing ignores curves used to drive distance attenuation #171

Open CodeHatchling opened 3 years ago

CodeHatchling commented 3 years ago

To reproduce:

  1. Create a new scene.
  2. Add an audio source, with a Steam Audio Source attached.
  3. On the audio source, ensure that "Spatialize" is enabled, with the spatial blend set to 1.
  4. On the audio source, use Logarithmic Rolloff, with the Min Distance set to 0.01, and Max Distance set to 500.
  5. On the Steam audio source, enable Distance Attenuation and ensure it is set to "Curve Driven".
  6. Enable "Pathing".
  7. Create a pathing probe batch large enough to encompass the distance between the audio source and listener.
  8. Add a floor to the scene, mark it as audio geometry.
  9. Bake the pathing data and scene data, then drag the data into the audio source's Pathing Probe Batch.
  10. Move the listener and probe so they are 10m apart.
  11. Ensure that both the probe and listener are within the volume of the Pathing Probe Batch, are within the area encompassed by the probes, and are above the floor.
  12. Press play, then toggle "Pathing" on the audio source.

Expected Behaviour: Audio is quiet; volume of the audio source does not change very much between toggling "Pathing" on and off; volume of sound is consistent with attenuation curves provided.

Actual Behaviour:

In our project, we are attempting "Physically Based Audio", in which audio source loudness is distinguished primarily by the "Min Distance" parameter when paired with Logarithmic Rolloff (AmplitudeObserved = AmplitudeAt1Meter / DistanceInMeters) Thus, quiet sounds have a short range, loud sounds have a long range, but their volume is always 1. This way quiet sounds, like a fly buzzing, will be loud if they are right against your ear.

Originally my instinct was to use "Physics Based" attenuation, but this makes all sound sources equally loud (AmplitudeObserved = 1 / DistanceInMeters).

It appears that the Pathing feature also assumes "Physics Based" attenuation, thus it inherits the inability to distinguish sound loudness on range, rendering the feature unusable for our goal.

In general, the attenuation provided by the designer for direct sound should be respected by indirect (pathing-based) sound.

github-actions[bot] commented 6 months ago

This issue has been automatically marked stale, and will automatically be closed in 30 days if no activity occurs.

lakulish commented 5 months ago

commenting to keep open

erox455 commented 5 days ago

I can confirm this!