버전

menu_open
Wwise SDK 2023.1.8
Rooms and Portals API Configuration

Creating Rooms and Portals

You need to create Rooms and Portals based on the geometry of your map or level, with AK::SpatialAudio::SetRoom and AK::SpatialAudio::SetPortal. Room과 Portal에는, 동일한 ID로 이 함수들을 다시 호출하여 런타임에 변경할 수 있는 설정이 있습니다. 그러면 게임이 각 이미터와 리스너에 대해 AK::SpatialAudio::SetGameObjectInRoom 를 호출해 이들이 어느 공간에 있는지 Spatial Audio에게 알려줍니다. Spatial Audio 관점으로 보자면, Room에는 정의된 위치나 모양, 크기가 없습니다. 따라서 Room은 이론적으로는 어떤 모양이든 될 수 있지만, 오브젝트가 있는 Room에 대해 게임 엔진 단에서 반드시 교차 검사(containment test)를 거쳐야 합니다.

주의: Room ID를 주의하세요. Room ID는 게임 오브젝트와 동일한 범위를 공유하므로, 이미 게임 오브젝트로 사용 중인 ID를 사용하지 않도록 조심해야 합니다.
주의: Spatial Audio는 각 Room에 대해 게임 오브젝트를 Wwise에 등록합니다. 사용자는 환경/공간 톤 사운드를 위한 해당 게임 오브젝트에 이벤트를 전달할 수 있지만, AK::SoundEngine 호출시 오브젝트의 위치나 게임에서 정의한 센드를 변경해서는 안 됩니다.

Room 설정에 있어 가장 중요한 것은 AkRoomParams::ReverbAuxBus 로서, 해당 Room 안에 있을 때 이미터가 어느 보조 버스를 전송해야 할 지 Spatial Audio에게 알려줍니다. 다른 설정에 대해서는 아래 섹션에서 다룰 예정입니다 ( Setting Up a Room Auxiliary Bus in WwiseTransmission 을 참고하세요).

Portal은 두 Room 사이 열려있는 공간을 나타냅니다. Room과는 반대로 Portal은 위치와 크기가 존재하기 때문에 Spatial Audio가 스스로 교차 검사를 할 수 있습니다. Portal의 크기는 Portal 설정 AkPortalParams::Extent에서 결정합니다. 너비와 높이(X와 Y)는 Spatial Audio가 회절과 확산을 계산하는 데 사용하며, 깊이(Z)는 연결된 두 Room 사이 부드러운 전환을 만들어내는 영역을 정의합니다. 이 때 Spatial Audio는 보조 전송 레벨과 Room 오브젝트 배치, Spread(확산, 3D Spatialization에 사용됨)를 신중히 처리합니다. Refer to sections Setting Up a Room Auxiliary Bus in Wwise and Summary of Sound Propagation Features below for more details. Portal은 또한, AkPortalParams::bEnabled Portal 설정을 통해 활성화(열림)하거나 비활성화(닫힘)할 수 있습니다.

Posting Events on Room Game Objects

It is possible to post an event on a Room Game object to take advantage of their spatialization behavior. Simply call AK::SoundEngine::PostEvent, passing the room ID as the AkGameObjectID. The room ID can be safely cast to a AkGameObjectID by calling AkRoomID::AsGameObjectID. If a room is to be used for posting events, then Spatial Audio must be told not to unregister the Room Game Object when it is not in use. To do so, make sure to set AkRoomParams::RoomGameObj_KeepRegistered to true.

Additionally, when using room tones, it may be useful to have the Game Object send to its own Room Auxiliary Bus. To do so, pass a value greater than zero to AkRoomParams::RoomGameObj_AuxSendLevelToSelf.

Setting up Room Geometry

Associating a Geometry Instance with a Room serves the following purposes:

  • It enables calculation of the Room's bounding box, which in turn is used to calculate the position and spread of the Room's transmission path.
  • It allows Spatial Audio to determine which Game Objects are in which Room. Alternatively, clients can use AK::SpatialAudio::SetGameObjectInRoom for this purpose, if desired.
  • It enables accurate specification of transmission loss values, according to the transmission loss coefficient of each individual surface.
  • It enables the display of the room inside the Game Object 3D Viewer.
  • Optionally, it enables reflection and diffraction simulation using the walls of a room, if AkGeometryInstanceParams::UseForReflectionAndDiffraction is set to true.

Setting up Room geometry is optional but recommended. Without Room geometry, the Room will not be visible in the Game Object 3D viewer, and Spatial Audio will estimate the extent of the Room (for Room transmission) by calculating a bounding box that encompasses all attached portals. For more information about Room transmission refer to Transmission of Room Tones and a Room's Diffuse Field.

Spatial Audio performs containment tests using Room geometry to determine which Room each Game Object is in. If a specific type of containment test is desired, this task can instead by performed by the client, using AK::SpatialAudio::SetGameObjectInRoom. However, geometry is mandatory for Rooms that are designated as Reverb Zones, so that Spatial Audio can determine whether a Game Object is inside the transition region of a the Reverb Zone. Refer to spatial_audio_roomsportals_reverbzones_transition_regions.

To associate geometry with a Room, first, pass the geometry to Wwise using AK::SpatialAudio::SetGeometry. It is then necessary to create a Geometry Instance to assign a position, scale and rotation to the geometry. Refer to AK::SpatialAudio::SetGeometryInstance. Lastly, populate the AkRoomParams::GeometryInstanceID field when calling AK::SpatialAudio::SetRoom, with the ID of the Geometry Instance representing the room. Spatial Audio assumes that there was, or will be, a corresponding call to AK::SpatialAudio::SetGeometryInstance, however, it does not matter in which order AK::SpatialAudio::SetRoom and AK::SpatialAudio::SetGeometryInstance are called.

참고:
If a geometry instance is to be used only by a Room, for purposes listed above, and not for reflection and diffraction calculation, then set AkGeometryInstanceParams::UseForReflectionAndDiffraction to false.

For information about how to define geometry in Spatial Audio, refer to 지오메트리.

참고:
If a geometry set is only to be used for describing a Room and not for reflection and diffraction calculation, then make sure to set AkGeometryParams::EnableTriangles to false.
주의: AkRoomParams::GeometryInstanceID should not be confused with AkGeometryInstanceParams::RoomID. AkRoomParams::GeometryInstanceID is used as described above to define a room bounding box for transmission spread calculation and for visualization in the Game Object 3D Viewer. AkGeometryInstanceParams::RoomID is used solely as an optimization to limit the scope in which the geometry is visible/accessible, when performing ray traces inside of Spatial Audio.

Sound Emitters with Multiple Positions

When using AK::SoundEngine::SetMultiplePositions, Spatial Audio performs various calculations including reflections, diffraction and transmission for each sound position passed to the API.

There are a few important points to note when using AK::SoundEngine::SetMultiplePositions on game objects that use room sends, because a given game object can only be assigned to a single room at a given time (using AK::SpatialAudio::SetGameObjectInRoom). This limitation arises from the constraint that all sound positions must have the same Auxiliary send configuration inside the Sound Engine.

All sound paths that are calculated from an emitter's position are done so with respect to the (single) requested room. For this reason, in the case that a sound position is outside the (game-defined) boundary of the room set via AK::SpatialAudio::SetGameObjectInRoom, the resulting sound path will most likely be erroneous.

In addition, if the game object is transitioning through a portal, Spatial Audio takes the average of all sound positions passed to AK::SoundEngine::SetMultiplePositions and uses it to calculate a cross-fade between the two rooms.

For this reason, it is recommended that the game also use the average sound position to derive room containment and pass the resulting room ID to AK::SpatialAudio::SetGameObjectInRoom.

Example Rooms and Portals Integration

SDK/samples/IntegrationDemo에 위치한 Integration Demo 예제에는 API 사용 방법을 보여주는 데모 페이지가 있습니다. Demo Positioning > Spatial Audio: Portals 를 확인하세요.


이 페이지가 도움이 되었나요?

지원이 필요하신가요?

질문이 있으신가요? 문제를 겪고 계신가요? 더 많은 정보가 필요하신가요? 저희에게 문의해주시면 도와드리겠습니다!

지원 페이지를 방문해 주세요

작업하는 프로젝트에 대해 알려주세요. 언제든지 도와드릴 준비가 되어 있습니다.

프로젝트를 등록하세요. 아무런 조건이나 의무 사항 없이 빠른 시작을 도와드리겠습니다.

Wwise를 시작해 보세요