Performance budget indicators

From PopcornFX
Jump to navigation Jump to search

Performance budget indicators are a set of visual cues inside the editor, designed to make potential performance problems stand out as early as possible during production. They are fairly basic estimates, and should not be taken as 100% accurate.
They are obviously not meant to replace real testing in the final game/application, but they still provide valuable, easy-to-see, visual clues when creating an effect.

(you can also see the performance budget indicators video tutorial)

Global budgets

The global performance budget indicators are the 3 colored horizontal bars at the top right corner of the realtime viewport in the particle editor.
They give a rough idea on how bad the effect will hurt performance and memory.

PerfBudgets0 1.png

Greenish colors mean it's good, reddish colors means it's too heavy and the effect should probably be simplified.

The three bars are:

  • Particle count
  • Memory used per instance
  • Overdraw estimate

Here are a few examples:

PerfBudgets1 1.png Okay, very light effect, you can have hundreds of instances of that effect at the same time, it won't hurt performance too much.

PerfBudgets2 1.png Okay

PerfBudgets3 1.png Okay, watch out for overdraw, you can try using more particles, but smaller.

PerfBudgets4 1.png Might be okay, there shouldn't be too many instances of this effect at the same time.

PerfBudgets5.png Probably not okay ! very heavy effect

PerfBudgets6.png Definitely not okay !

The configuration fields that control these budgets are: (see the 'Configuration' section)

  • Budget_ParticleCount
  • Budget_InstanceMemoryKb
  • Budget_Overdraw

Particle medium charts

In addition to the global budgets, you can also visualize relative overdraw vs primitive count distribution for all active particle mediums, using the pie-chart display:

PerfBudgets Charts 0 .png

  • The 'Overdraw' chart displays the relative overdraw of each medium
  • The 'Primitives' chart displays the primitive count of each medium

A medium shouldn't have a too large discrepancy between its primitive count slice size and its overdraw slice.
Their relative sizes can tell you either:

  • There are too many small particles that don't contribute enough compared to the other particles, and could probably be batched into larger particles with a different texture, if the primitive slice is much larger than the overdraw slice
  • The particles are too large, if the overdraw slice takes up most of the chart, and is much larger than the primitive count slice.

Script budgets

Since version, in addition to the per-line performance estimate coloration, the script editor also displays a global performance indicator for the whole script, in the top-right toolbar corner:

PerfBudgets Script0.png
Cheap script

PerfBudgets Script1.png
More costly script

The configuration fields that control these budgets are: (see the 'Configuration' section)

  • Budget_ScriptSpawn
  • Budget_ScriptEvolve

depending on the script type.


You can configure the budgets in the Particle Editor config (to open the 'Preferences' panel, go to the 'View' menu in the content browser, and select 'Preferences')

Config ParticleEditor 1 .png

For each budget type, there are 3 different values you can configure. they must all be in ascending order, and correspond to the min, medium, and max values of your budgets.
Note that the budget bar will actually display values higher than the 'max' values.
cursor and color progression is linear between the min and max values, and exponentially slower between the max value and the end of the budget bar.

1- Budget_ParticleCount [Min,Med,Max]
values are in particles per effect instance. here, a 2000-particles effect is considered medium, and an 8000-particles effect is considered heavy
2- Budget_InstanceMemoryKb [Min,Med,Max]
values are in Kilo-bytes of system-ram per effect instance. here, an effect that uses 100 Kb is considered medium, and an effect that uses 2 Mb is considered heavy
3- Budget_Overdraw [Min,Med,Max]
values are in overdraw fraction of the total effect projected screen area. 1 means there is the same number of pixels drawn as there are pixels written, 10 means for each screen pixel, there are 10 pixels drawn by the effect (roughly equal to 10 fullscreen layers blended on top of each other)
4- Budget_ScriptSpawn [Min,Med,Max]
budgets used for all spawn scripts, in streamed meta-cycles
5- Budget_ScriptSpawn [Min,Med,Max]
budgets used for all evolve scripts, in streamed meta-cycles