Version
menu

Wwise SDK 2025.1.4
AkCmd_SA_SetImageSource Struct Reference

#include AkCommandTypes.h>

Public Attributes

AkImageSourceID imageSourceID
 The ID of the image source being added. More...
 
struct AkImageSourceSettings info
 Image source information. More...
 
AkUniqueID auxBusID
 Aux bus that has the AkReflect plug in for early reflection DSP. Pass AK_INVALID_AUX_ID to use the reflections aux bus defined in the authoring tool. More...
 
AkGameObjectID gameObjectID
 The ID of the emitter game object to which the image source applies. Pass AK_INVALID_GAME_OBJECT to apply to all game objects that have a reflections aux bus assigned in the authoring tool. More...
 

Detailed Description

Add or update an individual image source for processing via the AkReflect plug-in. Use this API for detailed placement of reflection image sources, whose positions have been determined by the client, such as from the results of a ray cast, computation or by manual placement. One possible use case is generating reflections that originate far enough away that they can be modeled as a static point source, for example, off of a distant mountain. The SpatialAudio API manages image sources added via AkCmd_SA_SetImageSource and sends them to the AkReflect plug-in that is on the aux bus with ID auxBusID. The image source applies all game objects that have a reflections aux send defined in the authoring tool, or only to a specific game object if gameObjectID is used.

Note: The AkImageSourceSettings struct passed in info must contain a unique image source ID to be able to identify this image source across frames and when updating and/or removing it later.
Each instance of AkReflect has its own set of data, so you may reuse ID, if desired, as long as in_gameObjectID and in_AuxBusID are different.

Note: It is possible for the AkReflect plugin to process reflections from both SetImageSource and the geometric reflections API on the same aux bus and game object, but be aware that image source ID collisions are possible. The image source IDs used by the geometric reflections API are generated from hashed data that uniquely identifies the reflecting surfaces. If a collision occurs, one of the reflections will not be heard. While collision are rare, to ensure that it never occurs use an aux bus for SetImageSource that is unique from the aux bus(es) defined in the authoring tool, and from those passed to SetEarlyReflectionsAuxSend.
Note: For proper operation with AkReflect and the SpatialAudio API, any aux bus using AkReflect should have 'Listener Relative Routing' checked and the 3D Spatialization set to None in the Wwise authoring tool. See Bus instances for more details.

Optionally, you can associate a name to the image source for profiling purposes. Call AK_CommandBuffer_AddString after adding the command to attach a name to the image source:

auto cmd = (AkCmd_SA_SetImageSource*)AK_CommandBuffer_Add(buffer, AkCommand_SA_SetImageSource);
// Fill command...
AK_CommandBuffer_AddString(buffer, "My image source");

This command can fail for the following reasons:

  • AK_IDNotFound: gameObjectID was specified but is not registered.
See also

Definition at line 1392 of file AkCommandTypes.h.


Was this page helpful?

Need Support?

Questions? Problems? Need more info? Contact us, and we can help!

Visit our Support page

Tell us about your project. We're here to help.

Register your project and we'll help you get started with no strings attached!

Get started with Wwise