-
Notifications
You must be signed in to change notification settings - Fork 2
Using Optick Profiler
You can open Optick from inside the Engine in the menus Tools > Optick

Note that this is just a quick way top open the GUI included for convenience; Optick is a an executable fully independent from our engine and it can be downloaded and run by itself.
You can start recording a capture by pressing play and stop with the stop button (shown in the image). Once a capture is ended Optick will show the results.

For Optick to track the performance of a function some code needs to be included at the function's first line, we will use mainly the following two macros; (remember to include optick.h to use any of them)
Quickest way to track a function, it will automatically get the function's name and show it in Optick. Use it as this:
void AnyFunction()
{
OPTICK_EVENT();
... Slow code ...
}
You can optionaly pass your own name for the scope with OPTICK_EVENT("Name");
This does virtualy the same thing as OPTICK_EVENT, but lets you also add a Category. Each category shows up in Optick profiler with a predefined color, to see all the available categories check optick.h
The instrumentation code needs to be inside the tracked function and thus can't possibly be separated from the game code. Instead, to prevent any code from Optick making it into release builds of the game we must use the optick.config.h file. By disabling the Global constant USE_OPTICK all the code from optick will stop being compiled.
- Optick Github: https://github.com/bombomby/optick
- Optick's full API: The macros explained here are only the most basic. Check out the full API for more advanced uses like automatically creating captures.
- Tutorial Video: Detailed tutorial to use the Optick GUI