Vixen
02b45cc4
csharp
public record class AudioReverbZone

A region of space that sounds like somewhere.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

It needs no physics, which is why it does not ask for any. Occlusion is a raycast and has to be answered by something that owns geometry; "is the listener inside this volume" is a subtraction and a comparison. Writing this against a trigger volume would have made reverb a feature only games with a physics engine could have, in exchange for nothing — so a zone is arithmetic and works in a game that links no native library at all.

The listener decides, not the source. Reverb is the room you are standing in. A gunshot fired outside and heard from inside a cathedral gets the cathedral, because the reverberation happens around the ear and not around the muzzle. Testing the source instead is a mistake that sounds subtly wrong everywhere and obviously wrong at a threshold.

Blend is what stops a doorway being a switch. Inside the inner extent the zone is fully on; between there and the outer edge it fades. Without it, walking across a boundary swaps one reverb for another in a single frame, which is a sound nobody has ever made by walking.

What it drives is a parameter, like everything else. A zone does not hold a reverb; it holds the name of a parameter and pushes a number into it. What that number does — an aux send opening, a wet level, a filter — is drawn on a curve in an asset. So "the cellar is boomier" is an edit rather than a build.

Fields and properties (7)

  • public string Parameter

    Which parameter this zone drives when the listener is inside it.

  • public Vector3 Position

    Where it is.

  • public AudioZoneShape Shape

    Sphere or box.

  • public Vector3 Extent

    For a sphere, its radius. For a box, half its size on each axis.

  • public float Blend

    How far in from the edge the zone reaches full strength, in world units.

  • public float Strength

    How strong it is at full strength.

  • public int Priority

    Which zone wins where two overlap. Higher takes it.

Methods (2)

  • public float Evaluate(in Vector3 listener)

    How much this zone applies at a point.

  • public float Evaluate(in Vector3 listener, in Vector3 centre)

    The same, centred somewhere other than Position.

Used by (8)

  • AudioReverbZoneRefVixen.Audio
  • AudioReverbZonesVixen.Audio
  • AudioZoneAssetVixen.Audio
  • PlacedVixen.Audio
  • ReverbZoneSystemTestsVixen.Audio.Tests
  • ReverbZoneTestsVixen.Audio.Tests
  • TypeRegistrationVixen.Audio
  • Vixen_Audio_Ecs_AudioReverbZoneRefSerializerVixen.Audio