PopcornFX v2.9

Generic selectors
Exact matches only
Search in title
Search in content
  1. Home
  2. Docs
  3. PopcornFX v2.9
  4. Plugins
  5. UE4 plugin
  6. Performance

Performance

Overview

PopcornFX performance can be inspected in various ways

UE4 Plugin Menu

Some performance helpers can be accessed via the PopcornFX menu in UE4 toolbar.

UE4 Plugin commands

It is also possible to invoke specific commands from the console

Stats

UE4 Plugin Stats

There are several ways to display general stats for the plugin:

  • Type stat popcornfx in the console
  • Select Cmd stat PopcornFX in the PopcornFX Menu of UE4 toolbar
  • Select the Stats > Advanced > PopcornFXmenu from any UE4 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

UE4 Plugin HUD

There are several ways to display the top offenders view (also named HUD profiler):

  • Type PopcornFX.ToggleProfilerHUD in the console
  • Select Cmd ToggleProfilerHUD in the PopcornFX Menu of UE4 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.

Memory profiler

UE4 Plugin Memory HUD

This is legacy from PopcornFX v1 and will be re-worked in future plugin versions.

Threading

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 UE4’s task graph, which allows better scheduling with other UE4 tasks (& less worker threads)

 

To enable this code path, simply add the following 2 lines to your project’s Config/DefaultEngine.ini file:

[PopcornFX]
bUseUETaskGraph=True

 

At startup, the plugin will fetch this variable to determine whether or not to use UE4’s task graph. Enabling this effectively lets UE4 schedule PopcornFX tasks in its task graph. Knowing that UE4’s task graph will be tweaked by Epic per platforms, based on UE4’s workload and frame layout, ultimately it’s best to use this option for PopcornFX particles.

Note: In future PopcornFX UE4 plugin versions, this might become the default.

Unreal Insights

UE4 Plugin Unreal Insights

All “scope cycle” markers the plugin registers (viewed when using the stat popcornfx command) are visible by default in UE4 Insights.

 

To view PopcornFX C++ SDK tasks content, add this to your project’s Config/DefaultEngine.ini file:

bRecordProfileMarkers=True

 

Note: It is mandatory to enable bUseUETaskGraph, like so:

[PopcornFX]
bUseUETaskGraph=True
bRecordProfileMarkers=True

 

For the capture above, UE4 Editor was launched with the following additional options: -tracehost=127.0.0.1 -trace=cpu -statnamedevents

Legacy profiler

UE4 Plugin Legacy Profiler

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 PopcornFX.RecordProfilerReport.

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.

LLM

UE4 Plugin LLM

PopcornFX memory is tracked through UE4’s Low Level Memory Tracker, in the Particles category.

In UE4.26, it is currently not possible to register a custom PopcornFX section

Was this article helpful to you? Yes No

How can we help?