Table des matières
-
Lessons
When the SLOW-MO mode is not activated, there is simply no reason for the Pitch Shifter to be active; therefore, it can be bypassed to save resources. Let’s head into the Profiler layout and monitor the CPU usage on normal speed.
-
From the Views menu, select Soundcaster.
-
Using the Selector, select the Lesson 4 - Bypassing Effects session.
-
From the toolbar, select Start Capture.
Notice that the counter on the right will start to go up, and the button will be highlighted in red.
-
On the Ambient_Region_Desert Event, click Play.
If you don’t hear anything, make sure the Distance_to_Player Game Parameter is set to 0. You’ll find it in the RTPCs list in the Soundcaster.
-
Let it run for 3 seconds, then click Stop Capture to stop capturing.
-
In the SoundCaster, click Stop.
-
In the Profiler layout’s Advanced Profiler, make sure the CPU tab is selected.
In the CPU tab, you’ll see the Pitch Shifter Effect, and in the % CPU column you’ll see the CPU usage.
By dragging the time cursor in the Performance Monitor, you can see the usage over the duration of your capture. Despite not being in SLOW-MO mode, the CPU uses a small amount of CPU processing on just having it active and, as such, you can completely remove this usage by bypassing the Effect.
You can bypass the Effect when it reaches a certain value using an RTPC.
-
From the Layouts menu, select Designer.
-
In the Project Explorer, expand the Master-Mixer Hierarchy > Default Work Unit > Master Audio Bus and select the World Bus.
-
In the Object Tab, select the RTPC tab.
All elements in the Effects tab can be bypassed in the RTPC tab. All that is needed is to link an RTPC to a certain Bypass Effect item number.
-
From the Y axis Selector, add Bypass Effect > Bypass [0]: (Pitch Shifter).
-
From the X axis Selector, add the Game Parameters > Gameplay > Game_TimeSpeed parameter.
When the time speed is 1, the game will run at normal speed. As such, let's make a bypassed region around 1.
-
Set a very small region (0.99 to 1.01) next to the normal timespeed to True, and the rest to False.
When the Game_TimeSpeed is normal it will not be active at all; but, if the speed increased or decreased, it’ll enable the Effect again. While not being in SLOW-MO mode, you’ve now completely removed the resource usage of the Wwise Pitch Shifter when not used.