Table des matières
-
Lessons
When applying Effects, you should always keep an eye on the number of Effect instances. Let's demonstrate this by applying the Pitch Shift Effect on the Boulder_Near Blend Container.
If you apply the Pitch Shift Effect on the Boulder_Near Blend Container, all four Sound SFXs will inherit the Effect, resulting in four instances of the Pitch Shift Effect.
Another solution is to set the output of the Boulder_Near Blend Container to the Boulder Audio Bus and apply the Pitch Shift Effect to that Audio Bus.
Considering that both the Audio Bus and the Sound SFX are mono, the comparison is pretty straightforward. However, if you only had one Sound SFX set to a stereo Audio Bus, it would have been less efficient to apply the Effect on the Audio Bus.
Let’s demonstrate how to determine the number of Effect instances, by the use of the Pitch Shift Effect in SLOW MO mode, and compare the Effect placement.
-
In the Project Explorer’s Actor Mixer Hierarchy > Default Work Unit, select the World Actor Mixer.
-
Select the Effects tab.
-
Using the Selector in ID 0, click Add Effect (+), then select the Pitch Shifter > Pitch Shift > WAG_PitchShifter_SlowMotionMode ShareSet.
-
From the Layouts menu, select SoundBank.
-
Click Generate All.
The Generate All option will not require you to select soundbanks, platforms or languages. However, to reduce the wait of generating SoundBanks, you can select only the All_In_One SoundBank, your platform and language and select Generate Selected.
-
From the WAG Unity project’s Audiokinetic menu, go to Certification > 251 > Lesson 4 and select Slow Motion.
-
Click Play to enter play mode.
-
Back to Wwise, connect to the game using the Remote Connections dialog.
-
Returning to Unity, from the WAG in-game menu, enable SLOW-MO.
-
Teleport to the Woodlands and attack the Evil Spit Plant on the plateau.
-
Click Play, to exit play mode.
Let’s now use the Advanced Profiler and evaluate the performance of the Wwise Pitch Shifter.
-
From the Profiler layout, select the Plug-ins tab of the Advanced Profiler view.
Within this tab you’ll be able to monitor the processing used by each individual plug-in. Notice that the Pitch Shifter Number of Instances is 10 (this may vary from 10-20 depending on what you do in gameplay). When applying the Effect on the World Actor-Mixer in the AM Hierarchy, an instance of the Effect is passed on to all child audio structures, unless they are overriding their parent Effect settings.
When an audio structure inherits an Effect, the applied Effect will show in the Effects tab, grayed out. The placement of the Wwise Pitch Shifter on an object of the AM Hierarchy caused the Effect to be distributed onto 10 different objects, each using a proportion of resources. Another way of applying such an Effect would be to place it in the MM Hierarchy on an Audio Bus. As described earlier, when applying the Effect on an Audio Bus, the audio sent to that bus would first be mixed (into the number of channels set in the Channel Configurations) and then the Effect would be applied.
-
From the Layouts menu, select Designer.
-
In the World Actor-Mixer’s Effects tab, select the Pitch Shifter Effect, then click Delete Effect(s) (trash icon).
-
Under the Project Explorer’s Master-Mixer Hierarchy > Default Work Unit > Master Audio Bus, select the World Bus.
-
In the Object Tab's Effects tab, click Add Effect (+), then select Wwise Pitch Shifter > Pitch Shift > WAG_PitchShift_SlowMotionMode.
-
From the Layouts menu, select SoundBank.
-
Click Generate All.
-
From the WAG Unity project’s Audiokinetic menu, go to Certification > 251 > Lesson 4 and select Slow Motion.
-
Click Play.
-
Profile the game using the Remote Connections window.
-
Back to Unity, from the WAG in-game menu, enable SLOW-MO.
-
Teleport to the Woodlands and attack the Evil Spit Plant on the plateau.
-
Click Play, to exit play mode.
If you look in the Advanced Profiler’s Plug-ins tab, the Wwise Pitch Shifter’s Number of Instances column shows the number of instances have now been reduced to 1 from the original ~10.
Each of the objects that inherited the Effect are sending to the World Bus. Consequently, the result is the same, just with a notable difference in processing instances.