版本

menu_open
警告:系统已根据您所用大版本 (2022.1.13.8454) 自动跳转至最新文档。若想访问特定版本的文档,请从 Audiokinetic Launcher 下载离线文档,并在 Wwise 设计程序中勾选 Offline Documentation 选项。
Wwise SDK 2022.1.13
Obstruction and Occlusion with Game-defined Auxiliary Sends

In games, it is common for a game object to be either partially blocked (obstructed) by another object such as a wall or beam, or completely blocked (occluded) in a room where the listener can only hear a few sounds that pass through the walls. You can use auxiliary sends to represent the reflections of the signal.

Wwise does not compute obstruction and occlusion levels by itself. The game must perform the physics calculations and pass the results to the sound engine with AK::SoundEngine::SetObjectObstructionAndOcclusion().

The Wwise sound engine maps the obstruction and occlusion levels to a set of volume, low-pass filter, and high-pass filter curves that you define in Wwise. By default, these curves are project-wide, but you can use Attenuation ShareSets to customize them for different sounds. These curves are then applied to sound objects as they are influenced by obstruction and occlusion during gameplay. The values you define are relative, and are added to any volume and LPF/HPF values already applied to the game object.

In the implementation of these conditions, the sound engine calculates percentage values and assigns them to both obstruction and occlusion to enhance realism. These percentages are based on real-time positioning information from the game engine and can reflect a game object's movement in and out of a blocked area. For example, a spy character might move through an art gallery full of large sculptures. The percentage of obstruction could change depending on where the spy is as they pass behind each sculpture. Similarly, the percentage of occlusion could shift as the spy slowly sneaks out of a completely occluded broom closet.

It is possible to use obstruction and occlusion in combination with Spatial Audio, or independently. For more information about Spatial Audio, see Spatial Audio.

以下是声音引擎中声障/声笼处理管线的示意图:

声障/声笼处理管线

Understanding Obstruction

Obstruction occurs when an object in the game, such as a wall or pillar, partially blocks the space between a sound source and a listener. For example, in a spy game, player characters hiding behind a pillar could still hear gunshots in front of them.

声障的示例

Obstruction can be modeled by applying a volume control, Low Pass Filter (LPF), High Pass Filter (HPF), or a combination of the three to the direct path of the signal. 辅助发送反射不受影响。

Understanding Occlusion

Occlusion occurs when an object in the game geometry completely blocks the space between a sound source and its listener. For example, in a spy game, a player character might hear gunshots in the next room, even though there is a wall between the character and the discharged firearm.

声笼的示例

Occlusion can be modeled by applying a volume control, Low Pass Filter (LPF), High Pass Filter (HPF), or a combination of the three that affects both the direct path and the auxiliary send reflections of the signal. Obstruction and occlusion can happen simultaneously. The direct path is affected by both the obstruction and occlusion values. 然而,反射路径只受声笼值的影响。

设置声障和声笼

The game engine determines the obstruction and occlusion values from the position of the objects and listeners in the game's geometry.

Sound designers can set curves in Wwise Authoring to determine how the volume, LPF, and HPF react to calculated obstruction and occlusion values. They can also enable or disable any curve to best suit their performance and realism needs.

By default, all sounds use the curves specified in the Wwise project. For more information, see Defining Obstruction and Occlusion Curves for Your Project.

In the following example, an obstruction value of 1.0f (100%) produces a volume change of -50 dB on the source object. Obstruction and Occlusion levels must always be a value between 0.0f and 1.0f.

在 Wwise 中自定义工程 Obstruction 和 Occlusion 曲线

You can also use Attenuation ShareSets to enable, disable, and set obstruction and occlusion for separate sounds. For more information, see Applying Attenuation.

Game designers must calculate the obstruction and occlusion for each game object that affects each listener and pass the values to the sound engine with the AK::SoundEngine::SetObjectObstructionAndOcclusion() call.

When multiple listeners are enabled for a game object, the sound engine determines the minimum LPF value and maximum volume value that all listeners can hear. It then uses those values to compute the resulting obstruction/occlusion.

示例:设置声障和声笼

#define MAIN_LISTENER 0
// 游戏循环
while( TRUE )
{
(...)
for( int iGameObject = 0; iGameObject < nbObjects; iGameObject++ )
{
AkReal32 fCalculatedObs, fCalculatedOcc;
pGeometryModule->GetObsAndOccForGameObject( iGameObject, MAIN_LISTENER, &fCalculatedObs, &fCalculatedOcc );
AK::SoundEngine::SetObjectObstructionAndOcclusion( iGameObject, MAIN_LISTENER, fCalculatedObs, fCalculatedOcc );
}
(...)
}

Additional Resources

参见
float AkReal32
32-bit floating point
AKSOUNDENGINE_API AKRESULT SetObjectObstructionAndOcclusion(AkGameObjectID in_EmitterID, AkGameObjectID in_ListenerID, AkReal32 in_fObstructionLevel, AkReal32 in_fOcclusionLevel)

此页面对您是否有帮助?

需要技术支持?

仍有疑问?或者问题?需要更多信息?欢迎联系我们,我们可以提供帮助!

查看我们的“技术支持”页面

介绍一下自己的项目。我们会竭力为您提供帮助。

来注册自己的项目,我们帮您快速入门,不带任何附加条件!

开始 Wwise 之旅