Skip to content

Register meshes above a certain threshold of CMF bounds for audio geometry - #174

Open
phevosccp wants to merge 12 commits into
mainfrom
audio-occluder-selection
Open

phevosccp wants to merge 12 commits into
mainfrom
audio-occluder-selection

Conversation

@phevosccp

Copy link
Copy Markdown
Member

Description

This PR reduces the geometry trinity passes to carbon-audio, it uses the box around the mesh's audio geometry, the min/max bounds read from the CMF to create a threshold. It also fixes instanced child meshes registering an occluder where nothing is drawn. Default is 500m but it can be tweaked from a client and possibly will change in the future.

  • CMF meshes marked as non-occluding register nothing instead of falling back to the lowest LOD.
  • Instanced EveChildMesh registers one EveAudioOccluder per instance.
  • isAudioOccluder exposed on EveSpaceObject2.

Testing

Tested using the probe and a frontier client, it improved total CPU and voice starvation drastically.

A child mesh drawn as instances, such as an instanced hull, registered one
occluder at the child's own transform, where no copy is drawn. Each copy now
occludes where it is drawn. Copies whose transform is not affine get none.
An audio occlusion mesh with bounds but no triangles marks a mesh that does
not block sound, such as a pole, lattice or debris. It registers no audio
geometry, instead of falling back to its lowest render LOD.
A mesh whose bounding box is under eveAudioOcclusionMinSize across its middle
side is not registered with carbon-audio. Every mesh in Wwise costs ray tracing
time, and the small ones block little. The limit is 1000 m by default, 0 hands
over every mesh, and it can change while a scene runs.
isAudioOccluder is exposed on EveSpaceObject2. Ships only listen, but a ship
drawn with another model class, such as a Creation, is not an EveShip2, so the
game turns occlusion off for it.
A mesh whose audio bounds were never filled in has no size to judge, so it is
handed to carbon-audio instead of being left out at every limit, 0 included.
A size limit that is negative or not a number reads as 0, which also stops a
NaN limit from registering every instanced copy again on every frame.
The marker now needs both the vertices and the triangles to be missing. A mesh
that was simplified down to vertices without triangles still falls back to its
lowest render LOD.
A child mesh drawn as instances registered one occluder at its own transform
while it had no instance transforms, where nothing is drawn. It now registers
none. The copies are also only looked at again when the child moved, the
instance transforms, the geometry or the size limit changed, instead of twice
on every frame.
@phevosccp phevosccp changed the title Register only the meshes that block sound with carbon-audio Register meshes above a certain threshold of CMF bounds for audio geometry Dec 3, 2026
@phevosccp
phevosccp marked this pull request as ready for review December 3, 2026 13:42
@phevosccp
phevosccp requested a review from a team as a code owner December 4, 2026 13:32

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cpp-linter Review

Used clang-format v21.1.8

Click here for the full clang-format patch
diff --git a/trinity/Eve/SpaceObject/Children/EveChildMesh.cpp b/trinity/Eve/SpaceObject/Children/EveChildMesh.cpp
--- a/trinity/Eve/SpaceObject/Children/EveChildMesh.cpp
+++ b/trinity/Eve/SpaceObject/Children/EveChildMesh.cpp
@@ -1289,2 +1289 @@ void EveChildMesh::UpdateAudioGeometry( bool allowAudioGeometry )
-	const bool changed = m_audioInstancesDirty || m_audioInstancesGeometryId != geometryId || m_audioInstancesMinSize != minSize
-		|| m_audioInstancesRegisteredTransform != m_worldTransform;
+	const bool changed = m_audioInstancesDirty || m_audioInstancesGeometryId != geometryId || m_audioInstancesMinSize != minSize || m_audioInstancesRegisteredTransform != m_worldTransform;

✨ Powered by cpp-linter • 💬 Feedback

Comment on lines +1289 to +1290
const bool changed = m_audioInstancesDirty || m_audioInstancesGeometryId != geometryId || m_audioInstancesMinSize != minSize
|| m_audioInstancesRegisteredTransform != m_worldTransform;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

clang-format suggestion

Suggested change
const bool changed = m_audioInstancesDirty || m_audioInstancesGeometryId != geometryId || m_audioInstancesMinSize != minSize
|| m_audioInstancesRegisteredTransform != m_worldTransform;
const bool changed = m_audioInstancesDirty || m_audioInstancesGeometryId != geometryId || m_audioInstancesMinSize != minSize || m_audioInstancesRegisteredTransform != m_worldTransform;

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.

1 participant