Audio: Occlusion – Arma Reforger
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Lou Montana moved page Arma Reforger:Audio: Vehicle Occlusion to Arma Reforger:Audio: Occlusion without leaving a redirect: Page grouping) |
Lou Montana (talk | contribs) (Add Building occlusion) |
||
Line 1: | Line 1: | ||
{{TOC|side}} | |||
== Buildings == | |||
Building occlusion describes sound attenuation based on whether or not a sound emitter and the listener are in the same room (or a room at all). | |||
The system goes hand-in-hand with Light Portals and the room areas created by the system. | |||
=== Signals and Variables === | |||
There are four main signals and {{Link|Arma Reforger:Audio Editor: Audio Variables|variables}} that handle building occlusion: | |||
* {{hl|GInterior}}: float between 0 and 1 (1 if the current camera position is inside a building, 0 if outside, may gradually interpolate from 0 to 1 when entering a portal). | |||
* {{hl|Interior}}: per-entity signal that returns 1 if the entity is inside a building. | |||
* {{hl|GRoomSize}}: returns the size of the room the listener is located in, or 0 if it's not in any room. | |||
* {{hl|RoomSize}}: per-entity signal that returns the size of the room the entity is located in, or 0 if it's not in any room. | |||
The listener and emitter are considered to be "in the same room" if | |||
* {{hl|GInterior}} OR the emitter's Interior signal are 1 '''and''' | |||
* {{hl|GRoomSize}} and the emitter's {{hl|RoomSize}} signal are identical | |||
=== Examples === | |||
{| class="valign-top" | |||
| '''Listener inside, emitter outside (or vice versa)'''<br>If the listener is inside ({{hl|GInterior}} = 1) and the emitter is outside ({{hl|Interior}} = 0), or vice versa, full attenuation is applied. | |||
| [[File:armaR-audio building occlusion example 1.png]] | |||
|- | |||
| '''Listener inside, emitter inside, matching roomSizes'''<br>If both listener and emitter are inside ({{hl|GInterior}} = 1, {{hl|Interior}} = 1) and GRoomSize and the emitter's RoomSize signal are identical, then the emitter is considered to be in the same room as the listener. | |||
| [[File:armaR-audio building occlusion example 2.png]] | |||
|- | |||
| '''Listener inside, emitter inside, but no matching roomSizes''' | |||
| [[File:armaR-audio building occlusion example 3.png]] | |||
|- | |||
| '''Portal radius'''<br>Portals have a certain radius around them at which the {{hl|Interior}} and {{hl|GInterior}} values gradually lerp from 0 to 1. If an entity stands in the middle of a doorway, for example, the {{hl|Interior}} signal will return 0.5 ({{hl|GInterior}} for the listener respectively). With the current occlusion setup, this is only used for players/listeners. | |||
| [[File:armaR-audio building occlusion example 4.png]] | |||
|- | |||
| '''Edge-case: Different buildings, same RoomSizes'''<br>If the emitter and listener are in two different buildings and the rooms they are in happen to have identical room sizes, no attenuation will be applied. | |||
| [[File:armaR-audio building occlusion example edge case.png|742px]] | |||
|} | |||
== Vehicles == | |||
[[File:armaR-audio vehicle occlusion.png|thumb|500px| | [[File:armaR-audio vehicle occlusion.png|thumb|500px| | ||
'''{{Color|darkred|Red:}}''' Base Coverage for the (driver) compartment, defined in {{hl|CompartmentManagerComponent}}.<br> | '''{{Color|darkred|Red:}}''' Base Coverage for the (driver) compartment, defined in {{hl|CompartmentManagerComponent}}.<br> |
Revision as of 14:18, 28 January 2025
Buildings
Building occlusion describes sound attenuation based on whether or not a sound emitter and the listener are in the same room (or a room at all). The system goes hand-in-hand with Light Portals and the room areas created by the system.
Signals and Variables
There are four main signals and variables that handle building occlusion:
- GInterior: float between 0 and 1 (1 if the current camera position is inside a building, 0 if outside, may gradually interpolate from 0 to 1 when entering a portal).
- Interior: per-entity signal that returns 1 if the entity is inside a building.
- GRoomSize: returns the size of the room the listener is located in, or 0 if it's not in any room.
- RoomSize: per-entity signal that returns the size of the room the entity is located in, or 0 if it's not in any room.
The listener and emitter are considered to be "in the same room" if
- GInterior OR the emitter's Interior signal are 1 and
- GRoomSize and the emitter's RoomSize signal are identical
Examples
Vehicles
Occlusion inside vehicle cabins uses the Coverage System and is defined by the GCurrVehicleCoverage audio variable as an arbitrary float value.
- Each compartment of a vehicle can be given a "base coverage" value, defined on the CompartmentManagerComponent.
- Inside the SlotManagerComponent, using the "Slot Mappers" class, each Slot can be assigned a coverage value that will be added to the overall coverage as long as the slot is not destroyed (e.g windows can break, resulting in a lowering of the coverage value).
- Therefore, the overall coverage for each vehicle department is the sum of the Base Coverage defined in the CompartmentManagerComponent and all additional slot coverage values defined in the SlotManagerComponent.