Skip to content

Audio portals - #27

Merged
phevosccp merged 11 commits into
mainfrom
audio-portals
Oct 26, 2026
Merged

phevosccp merged 11 commits into
mainfrom
audio-portals

Conversation

@phevosccp

Copy link
Copy Markdown
Member

Description

Adds Wwise Spatial Audio portals. AudPortal wraps AK::SpatialAudio::SetPortal and is placed through ITr2BoxVolume, the same way as AudRoom, so trinity and the API need no changes. Rooms without portals are sealed; portals connect them, e.g. a door between two rooms.

Related PRs:

carbonengine/trinity#119

Changes

  • AudPortal, sent to Wwise by AudRoomManager
  • Front and back rooms found automatically from the room boxes, a quarter of the portal's depth past each face, so a portal as deep as its wall still finds both rooms
  • New rooms must be found 3 updates in a row before they replace the portal's rooms in Wwise, so the moving origin doesn't make them flicker
  • Portals removed before the rooms they connect
  • Door obstruction and occlusion (SetPortalObstructionAndOcclusion) and adjacent room bleed
  • AudUnitBox, the box handling now shared by rooms and portals

Testing

  • Tested locally with the same tool as the rooms PR, which will be released in a future PR.
audiolab.mp4

@ccp-zoetrope ccp-zoetrope left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look mostly good! My biggest concern is that the portal sync logic in SyncPortalLocked has no tests. There are a lot of parameters to keep track of, and logic that's hard to follow and easy to forget when we come back to it. I'd like to see tests that cover at least:

  • a portal across a room wall gets the right front and back rooms
  • a portal with the same room on both sides isn't sent to Wwise
  • new rooms only replace the old ones after 3 updates in a row (this one in particular is odd and easy to forget without a test)

If you add tests for these and address the other comments, this is good to go.

Comment thread src/AudRoomManager.cpp Outdated
Comment thread src/AudRoomManager.cpp
Comment thread src/AudRoomManager.cpp

@ccp-zoetrope ccp-zoetrope left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good after your latest changes!

@phevosccp
phevosccp merged commit b0f4f84 into main Oct 26, 2026
12 checks passed
@phevosccp
phevosccp deleted the audio-portals branch October 26, 2026 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants