在使用与 UPrimitiveComponent
绑定的 AkLateReverbComponent 时,可告知 Wwise Unreal 集成 依据 UPrimitiveComponent
的大小和形状来自动指派混响 Aux Bus。
同样地,Wwise Unreal 集成 还可使用 UPrimitiveComponent
来估算特定混响参数,并通过 Driving Reverb RTPCs 加以调节。本教程将阐述如何自动指派 Aux Bus 并使用全局混响 RTPC 估算混响参数。
| 注記:
- UPrimitiveComponent is a generic Unreal Component that has size and shape. There are many Component types that are based on UPrimitiveComponent, including collision Components, brush Components and mesh Components. See UPrimitiveComponent for more information.
- Although Reverb Parameter Estimation is a feature of the AkLateReverbComponent, the AkSpatialAudioVolume contains an AkLateReverbComponent, so it can also make use of the feature.
- The Spatial Audio 教程准备工作 must be completed prior to starting this tutorial.
|
自动指派 Aux Bus
It is possible to automatically associate an Aux Bus with a Spatial Audio Room. You can set up a Reverb Assignment Table in the Integration Settings, which maps different Decay values to different Aux Buses.
The Decay value of a Room is the estimation of its T60 decay (see EstimateT60Decay), which is the time (in seconds) required for the sound reverberation in a physical environment to decay by 60 dB.
The following exercise demonstrates how to use the the Reverb Assignment Table to automatically determine which Aux Busses to use for each Room.
Reverb Assignment section the Integration Settings
Before you configure the Decay keys in the table, observe the estimated Decay values for the existing reverbs in the level.
- Open the SpatialAudioTutorialMap.
- In the World Outliner, select the Interior_SmallRoom
AkSpatialAudioVolume
. Selecting Auto Assign Aux Bus sets the Aux Bus to the Default Reverb Aux Bus specified in the Project Settings because the Reverb Assignment Table is not yet set up.
- 在 Interior_SmallRoom 所对应的 Details 面板中,启用 Auto Assign Aux Bus。
- 针对 "Interior_LargeRoom"
AkSpatialAudioVolume
重复步骤 2 和 3。
针对 Interior_SmallRoom 和 Interior_LargeRoom 启用 Auto Assign Aux Bus
Some text information is displayed above each AkSpatialAudioVolume
in the viewport when they are selected. Details 面板的 Reverb Parameter Estimation 中也会显示此信息。
- In Unreal, click Edit > Project Settings, then scroll to the Wwise section and click Integration Settings.
- Expand the Reverb Assignment Map section.
Reverb Assignment section the Integration Settings
- Open the Reverb Assignment Table asset.
- In the toolbar, click Add.
- Set the Decay value of the new row to 1.0 and set the Aux Bus to SmallRoom.
- Add another row with a Decay value of 2.0 and set the Aux Bus to LargeRoom.
Any Room with a Decay value between 0.0 and 1.0 sends to the SmallRoom Aux Bus and any Room with a Decay value between 1.0 and 2.0 sends to the LargeRoom Aux Bus. Decay values above 2.0 sends to the Default Reverb Aux Bus.
这时返回关卡,可看到为 Interior_SmallRoom 和 Interior_LargeRoom 指派了相应的 Aux Bus 值。
全局混响 RTPC
除自动指派 Aux Bus 外,还可在 Wwise 中通过全局混响 RTPC 来自动设置混响效果器的某些参数。我们可以采用这种方式设置三项参数:Decay、Predelay 和 HFDamping。您可以在 Integration Settings 中设置由哪些 RTPC 控制这些参数。
The HFDamping, or high frequency damping, value is an estimation of how much high frequencies are dampened compared to low frequencies. See EstimateHFDamping for more information.
The PreDelay value is an estimation of the time in milliseconds for the first reflection to reach the listener, assuming both listener and emitter are in the center of the environment. See EstimateTimeToFirstReflection.
设置 RTPC
为了使用全局混响 RTPC,我们需要在 Wwise 工程中添加三个 RTPC。
- 打开 Wwise 工程。
- Click Layouts > Designer.
- 在 Project Explorer 中,单击 Game Syncs 选项卡。
- Add three new Game Parameters called Decay, PreDelay and HFDamping.
- Set the Min, Max, and Default values of the three new Game Parameters as follows:
- Decay:
- Min: 0
- Max: 10
- Default: 0
- PreDelay:
- Min: 0
- Max: 1000
- Default: 0
- HFDamping:
- Min: -1
- Max: 1
- Default: 0
- In the Project Explorer, open the Audio tab.
- Under the Master-Mixer Hierarchy, double-click SmallRoom. The SmallRoom Aux Bus Object Tab opens.
- On the Effects tab, at the right of the RoomVerb Effect row, click Edit.
- In the Effect Editor, open the RTPC tab.
- Add Reverb entries for Decay Time, Pre Delay and HF Damping.
- In the X Axis column, add Game Parameters for each entry as follows:
- Decay Time: Decay
- Pre delay: PreDelay
- HF Damping: HFDamping
- 选中 Decay 映射,并在曲线上添加控制点。
- 将控制点的 X 和 Y 值全部设为 0.2。
- 选中 HFDamping 映射,并在曲线上添加控制点。
- 将 X 值设为 0.0,并将 Y 值设为 1.0。
- 选中列表中的所有映射。
- 右键单击其中一个映射并选择 Copy。
- 在 Property Editor 中打开 "LargeRoom" Aux Bus。
- On the Effects tab, at the right of the RoomVerb Effect row, click Edit.
- In the Effect Editor, open the RTPC tab.
- 右键单击空白 RTPC 列表并选择 Paste。Three RTPCs now control reverb parameters in our Wwise project. In the Unreal project, these RTPCs function as the Global Reverb RTPCs.
- In Unreal, open the Wwise Integration Settings.
- Under Reverb Assignment, expand the RTPCs subsection.
- Assign each new RTPC to the corresponding Global Reverb RTPC
The Three New RTPCs Assigned to the Global Reverb RTPCs
接下来可远程连接到 Wwise,并进入 Play In Editor 模式。If you observe the RTPC curves in Wwise while triggering the sounds in the small room and the large room, you can see how the reverb parameters change.
将一条混响 Aux Bus 用于不同的 Room 类型
With Global Reverb RTPCs, you can use one reverb effect for an entire level and drive the parameters dynamically for the different rooms in the level.
- 在 Wwise 工程中,创建新的 Aux Bus 并命名为 DynamicReverb。
- Add a RoomVerb Effect to this Aux Bus, using the Default Effect preset.
创建新的 'DynamicReverb' Aux Bus 并为其添加 'Wwise RoomVerb' Effect
- 将 RTPC 映射从 "SmallRoom" Aux Bus 的混响效果器复制并粘贴到 "DynamicReverb" Aux Bus 的混响效果器。
- In the Unreal project, clear all entries in the Reverb Assignment Table (described in 自动指派 Aux Bus).
- 将 Default Reverb Aux Bus 设为刚才创建的 "DynamicReverb" Aux Bus。
Now, if you remote connect and Play In Editor, both the Interior_SmallRoom and Interior_LargeRoom use the DynamicReverb Aux Bus, but the parameters are automatically adjusted for each room through the Global Reverb RTPCs.
结合自定义 Blueprint 类来使用混响估算
The following procedure demonstrates the single Aux Bus workflow through the use of a custom Blueprint Class that represents a single room. For demonstration purposes, the room is a simple cube with walls that the player can walk through. In this exercise, you will create a double-sided material (so that you can see the interior of the room) and then create the Blueprint Class.
- 在 Content Browser 中,转到 WwiseAssets/SpatialAudioDemo 文件夹。
- 右键单击 SpatialAudioDemoMeshMaterial 并选择 Duplicate。
- Name the new Material Instance "SpatialAudioDoubleSidedMaterial".
- 打开新的 Material Instance。
- In the Details panel under Material, select Two Sided.
- 保存 Material Instance。
- 在 Content Browser 中,转到 Blueprints 文件夹。
- 在文件夹中右键单击并选择 Blueprint Class。
- 选择将 Actor 作为 Parent Class。
- Name the new Blueprint "BPRoom".
- Open the new BPRoom Blueprint Class.
- On the Components panel, click Add and select the Cube component.
- Select the new Cube component and in the Details panel, under Materials, set Element 0 to SpatialAudioDoubleSidedMaterial.
- In the Components panel, select the Cube Component and add a Box Collision Component under it.
- Select the Box Collision Component and add the following Components under it:
- Ak Room
- Ak Late Reverb
- Ak Geometry Ensure that the Component hierarchy in your Blueprint Class looks like this:
- 选中 AkGeometry 组件。
- In the Details panel, under Geometry, ensure that the Mesh Type is set to Simple Collision.
- In the Surface Overrides section, set the AkAcousticTexture to Concrete.
- In the Components panel, select the Cube Component.
- Add a Point Light Component, which illuminates the room when the player walks inside it.
- 选中 Cube 组件。
- In the Details panel under Collision, set the Collision Presets to NoCollision.
- 选中 Box 组件。
- In the Details panel under Collision, set the Collision Presets to NoCollision. The player can now walk through the walls of the room.
- 编译并保存 Blueprint。
Before you can test the new room Blueprint, add a sound to play when you change between the rooms.
- 从 Content Browser 中的 Blueprints 文件夹打开 MyCharacter Blueprint。
- 在 Components 面板中,选中 Capsule 组件。
- Add an Ak Component and name it "SpatialSound".
将 Ak 组件添加到 'MyCharacter' Blueprint
- 选中 SpatialSound 组件。
- In the Details panel, set the Ak Audio Event to Play_SpatialSound.
- 打开 "MyCharacter" Blueprint 所对应的 Event Graph。
- Locate the Event BeginPlay node in the lower right of the Event Graph.
- Drag from the last Set Switch node and select Post Associated Ak Event (SpatialSound).
You can now place some rooms in your level.
- Drag several instances of the BPRoom Blueprint into the level.
- 将这些 Room 设为不同的大小。
- Change the Acoustic Texture on the AkGeometry Component in each of the rooms:
- 选择关卡中的 Room。
- 在 Details 面板中,选中 AkGeometry 组件。
- Change the AkAcousticTexture to a different value such as Brick, Carpet, or something else. Do this for all BPRoom instances in the level.
接下来可远程连接到 Wwise,并进入 Play In Editor 模式。The spatial sound is triggered immediately. As you walk into the different rooms, the appropriate reverb parameters are applied to the sound.
HFDamping 计算和 Acoustic Texture
When estimating the HFDamping value, the AkLateReverbComponent
uses the AkGeometryComponent
to identify its Acoustic Textures. In the previous section, an AkLateReverbComponent
and an AkGeometryComponent
were attached to the same UPrimitiveComponent
parent (the Box Component). With this configuration, when the AkLateReverbComponent
has a sibling AkGeometryComponent
, it automatically uses that sibling AkGeometryComponent
to calculate the HFDamping. However, if the AkGeometryComponent
has a different parent, you must explicitly associate the AkGeometryComponent
with the AkLateReverbComponent
through the AssociateAkTextureSetComponent function. This section demonstrates how to do so.
- 打开 "BPRoom" Blueprint。
- In the Components panel, drag the AkGeometry Component on top of the Cube Component. The AkGeometry Component is now attached to the Cube Component instead of the Box Component.
- 选中 AkGeometry 组件。
- In the Details panel, under Geometry, set the Mesh Type to Static Mesh.
- In the Surface Overrides section, set the AkAcousticTexture to Concrete.
- 打开 Blueprint 所对应的 Event Graph。
- Drag a node from the execution pin of the Even BeginPlay node and select Associate Ak Texture Set Component (AkLateReverb).
- Drag the AkGeometry Component from the Components panel and release it on top of the Texture Set Component pin.
You can now remote connect to Wwise and Play In Editor to test whether the HFDamping value is updated correctly. With this configuration, you can have a Static Mesh with multiple materials, and an attached AkGeometryComponent
that maps those materials to Acoustic Textures. You can then associate this AkGeometryComponent
with an AkLateReverbComponent
to make the textures drive the HFDamping value.