PopcornFX performance can be inspected in various ways
Some performance helpers can be accessed via the PopcornFX menu in UE toolbar.
It is also possible to invoke specific commands from the console
There are several ways to display general stats for the plugin:
stat popcornfxin the console
Cmd stat PopcornFXin the
PopcornFXMenu of UE toolbar
- Select the
Stats > Advanced > PopcornFXmenu from any UE viewport
Cycle counters provide general timings for parts of the CPU frame:
Update: PopcornFX update time: Total update thread time on the main thread (various task run asynchronously in worker threads)
Render: GDME: Total render thread time for emitting PopcornFX draw calls for regular render passes (Transparency, Opaque, ..)
Render: GDRTI: Total render thread time for emitting PopcornFX draw calls for raytracing passes
Counters provide a general view of the total number of particles, draw calls, mediums in all loaded levels at any given time.
Top offenders view
There are several ways to display the top offenders view (also named HUD profiler):
PopcornFX.ToggleProfilerHUDin the console
Cmd ToggleProfilerHUDin the
PopcornFXMenu of UE toolbar
This view provides high level information of what effects are currently loaded in all loaded levels. Effects can be filtered out by tweaking the plugin’s runtime settings.
This is legacy from PopcornFX v1 and will be re-worked in future plugin versions.
PopcornFX simulation and rendering is multithreaded, using a “worker thread” pool. By default, the plugin uses PopcornFX C++ SDK default thread pool, which will use all available logical cores, minus 2 (leaving the main thread & rendering thread). This works fine by default, but for game productions it is recommended to directly schedule PopcornFX tasks in UE’s task graph, which allows better scheduling with other UE tasks (& less worker threads)
To enable this code path, simply add the following 2 lines to your project’s Config/DefaultEngine.ini file:
At startup, the plugin will fetch this variable to determine whether or not to use UE’s task graph. Enabling this effectively lets UE schedule PopcornFX tasks in its task graph. Knowing that UE’s task graph will be tweaked by Epic per platforms, based on UE’s workload and frame layout, ultimately it’s best to use this option for PopcornFX particles.
Note: In future PopcornFX UE plugin versions, this might become the default.
All “scope cycle” markers the plugin registers (viewed when using the
stat popcornfx command) are visible by default in UE Insights.
To view PopcornFX C++ SDK tasks content, add this to your project’s Config/DefaultEngine.ini file:
Note: It is mandatory to enable
bUseUETaskGraph, like so:
For the capture above, UE Editor was launched with the following additional options:
-tracehost=127.0.0.1 -trace=cpu -statnamedevents
PopcornFX C++ SDK embeds a CPU profiler and allows viewing captured frames in a standalone .exe file.
To capture CPU frames, type in the console
By default, the command will capture 10 frames, and prompt you to enter a dst file name for the report. The saved file can then be drag & dropped onto ProfilerReplay executable.
This executable can be downloaded here.
Note: It not possible to record .pkpr files if
bRecordProfileMarkers is enabled.
PopcornFX memory is tracked through UE’s Low Level Memory Tracker, in the Particles category.
In UE4.26, it is currently not possible to register a custom PopcornFX section