Unity Workflow LibraryUWLAbout

Topic 11 · Audio

Spatial and 3D audio

Set rolloff from the real listener distance, choose a spatializer, and use reverb zones for places.

Rolloff and the listener

  • AudioRolloffMode has three modes: Logarithmic (real-world rolloff), Linear (volume lowers over the distance) and Custom (a curve).
  • The Audio project settings' Volume Rolloff Scale applies to Logarithmic sources only; higher values attenuate faster, and 1 simulates the real world (Audio settings).

LISTENER-DISTANCE-SETS-THE-ROLLOFF

  • The AudioListener sits on the camera. In a top-down or orbit game that camera is 30 m or more from the action, so default logarithmic rolloff with min distance 1 m attenuates every world sound by about 30 dB and makes loudness depend on where units stand. Measured: -28 to -32 dB at a 31 m listener distance. Authored Linear rolloff with min distance at or above the camera distance (30-90 m) brought it to 0 to -2 dB and kept full 3D pan. Set it on the pooled voices as authored data, and re-check it after any camera distance change.

Spatializers

  • The built-in panning only sets left and right gains from distance and angle, which gives directional cues on the horizontal plane (Audio Spatializer SDK).
  • A spatializer plugin is selected in Project Settings > Audio > Spatializer Plugin, then enabled per source with Spatialize (or AudioSource.spatialize).
  • The SDK page suggests enabling the spatializer only on nearby sounds and using plain panning on distant ones to save mixing-thread CPU.
  • Unless the plugin takes over distance attenuation, Unity applies the source's attenuation before spatialization and uses curve, Volume and mixer attenuation (not measured signal level) to estimate audibility for virtualization.

Reverb zones

  • A Reverb Zone applies a reverb preset depending on where the listener is: full inside Min Distance, fading in between Min and Max, none outside Max. Zones can overlap to combine effects.
  • Place zones in the scene as authored objects (caves, halls), so a human can see and move their gizmos.