Oven: Particle

COvenBakeConfig_Particle

Used for PopcornFX’s Particle effect files.
Applied to: *.pkfx

Property name

Default value

Description

All common properties, see COvenBakeConfig_Base

BakeMode

Binary

Can be any of the following:

  1. LeaveAsIs : performs a straight copy from the source to the target pack without changing anything

  2. Text : forces conversion to text format

  3. Binary : forces conversion to binary format

Endianness

LittleEndian

Only used when 'BakeMode' is set to 'Binary'. Can be any of the following:

  1. LittleEndian : writes the binary HBO file to little-endian format (native format for PC / PS4 / Xbox-One)

  2. BigEndian : writes the binary HBO file to big-endian format (native format for X360 / PS3 / PS-Vita / ARM / etc…​)

Note that if the endianness does not match the target platform, the runtime will still be able to load the files, but will take a bit more time in order to swap all the values to the platform’s format.

RemoveEditorNodes

true

If set to true, will remove all nodes unknown to the asset-baker (Usually editor-specific nodes).

ExtensionsRemap

<empty>

Array of extensions remaps. The baker will replace the extensions in all file-paths in the currently baked file.
For example, here’s how you would remap source .fbx paths to .pkmm, and .png + .tga to a .dds runtime format, if you’ve setup the texture ovens to convert all pngs and tgas to dds:

ExtensionsRemap =
{
    "fbx=pkmm",
    "png=dds",
    "tga=dds"
};

Compile

true

When enabled, will compile all layers into runtime IRs and store them in the effect file.

RemoveSource

true

When enabled, will strip all source nodegraphs and scripts from the effect file. Cannot remove source if 'Compile' is not 'true': Would produce a useless, empty effect with neither sources, nor compiled bytecodes.

BuildVersions

<empty>

Build versions: contains the list of build version tags

CompilerSwitches

<empty>

String containing a series of nodegraph compiler & optimizer switches. See below for the list of supported switches

BackendCompilers

<empty>

List of backend configuration structures of type ‘COvenBakeConfig_ParticleCompiler’ (see below)

COvenBakeConfig_ParticleCompiler

The particle compiler bake config is referenced by the 'BackendCompilers' array of the particle config object.
It allows you to setup specific command-lines to build the bytecode objects of the various backends. It is mainly used for the GPU D3D backends, where you can specify the commandline to send to d3dcompiler / fxc

Property name

Default value

Description

Target

CPU

Specifies the target backend

  1. CPU : CPU VM backend

  2. D3D11 : GPU D3D11 backend (desktop)

  3. D3D12 : GPU D3D12 backend (desktop)

  4. D3D11X : GPU D3D11 backend (Xbox One)

  5. D3D12X : GPU D3D12 backend (Xbox One)

  6. D3D12XS : GPU D3D12 backend (Xbox Series X)

BakeBytecodeCommandLine_Windows

<empty>

On Windows, bytecode bake command line. Usually to a d3dcompiler or fxc binary

BakeBytecodeCommandLine_Linux

<empty>

On Linux, bytecode bake command line

BakeBytecodeCommandLine_MacOsX

<empty>

On Macosx, bytecode bake command line

See the COvenBakeConfig_Base documentation page for command-line structure.

Compiler switches

This is a string containing a space-separated list of switches allowing control over the graph compiler and optimizer

COvenBakeConfig_Particle    $DDECD857
{
    BakeTarget = "Desktop";
    CompilerSwitches = "--determinism --determinism-mod=0x1234 --user-debug --geo-passes=2";
}

Here are all currently available compiler switches:

General control

-O0

No optimizations

-O1

Instruction optimizations enabled, no storage or global effect optimizations (similar to editor’s 'Editor' optimization level)

-O2

All optimizations enabled, user debug not removed (similar to editor’s ‘Shipping’ optimization level)

-O3

All optimizations enabled, user debug removed (default level when baking)

--sam-cfl
--no-sam-cfl

Fold constant samplers (default: ON)

--user-debug
--no-user-debug

Enable or disable user debug, for example constructs coming from the debug nodegraph or script namespace, such as debug.warning or debug.assert (default: OFF)

-Werror
-Winfo
-Wdisable

Turn all warnings into errors, infos, or disables them (default: OFF)# [.cf88]#[v2.19.0]

-Iwarning
-Ierror
-Idisable

Turn all infos into warnings, errors, or disables them (default: OFF) [v2.19.0]

-Werror=<n>
-Winfo=<n>
-Wdisable=<n>

Turn warning <n> into an error, info, or disables it (default: OFF) [v2.19.0]
See the list of compiler messages for possible values of <n>

-Iwarning=<n>
-Ierror=<n>
-Idisable=<n>

Turn info <n> into a warning, an error, or disables it (default: OFF) [v2.19.0]
See the list of compiler messages for possible values of <n>

-Wforce=<n>

Forces warning <n> to be a warning even if -Werror, -Winfo, or -Wdisable were specified. [v2.19.0]
See the list of compiler messages for possible values of <n>

-Iforce=<n>

Forces info <n> to be an info even if -Iwarning, -Ierror, or -Idisable were specified. [v2.19.0]
See the list of compiler messages for possible values of <n>

Feature control

--determinism
--no-determinism

Enable or disable determinism for this effect (default: OFF)

--determinism-mod=<n>

Seed modifier applied on the deterministic seed of each layer of the effect (default: 0)
Ex: --determinism-mod=0x1234

--fx-visibility
--no-fx-visibility

Enable/disable explicit effect visibility toggles from the SDK (default: Enabled) [v2.7.0]
When this is disabled, effect.isVisible() will always constant-fold to true

--fx-time-scale
--no-fx-time-scale

Enable/disable explicit effect time-scaling from the SDK (default: Enabled) [v2.7.0]
When this is disabled, effect.timeScale() will always constant-fold to 1.0, and effect.dt() will always equal scene.dt

--fx-teleport
--no-fx-teleport

Enable/disable effect teleport detection (default: Enabled) [v2.7.0]
When this is disabled, effect.isTeleporting() will always constant-fold to false

--no-fx-spatial-layers

Disable spatial layers (default: Enabled) [v2.15.0]

--no-fx-event-portals

Disable event-graph portals (default: Enabled) [v2.15.0]

--no-fx-sampler-animtrack

Disable animtrack samplers (default: Enabled) [v2.15.0]

--no-fx-sampler-audio

Disable audio samplers (default: Enabled) [v2.15.0]

--no-fx-sampler-curve

Disable curve samplers (default: Enabled) [v2.15.0]

--no-fx-sampler-eventstream

Disable event-stream samplers (default: Enabled) [v2.15.0]

--no-fx-sampler-image

Disable image samplers (default: Enabled) [v2.15.0]

--no-fx-sampler-imageatlas

Disable image atlas samplers (default: Enabled) [v2.20.0]

--no-fx-sampler-grid

Disable grid samplers (default: Enabled) [v2.19.0]

--no-fx-sampler-shape

Disable shape samplers (default: Enabled) [v2.15.0]

--no-fx-sampler-text

Disable text samplers (default: Enabled) [v2.15.0]

--no-fx-sampler-vectorfield

Disable vector-field samplers (default: Enabled) [v2.15.0]

--no-fx-attrsampler-animtrack

Disable animtrack attribute samplers (default: Enabled) [v2.15.0]

--no-fx-attrsampler-audio

Disable audio attribute samplers (default: Enabled) [v2.15.0]

--no-fx-attrsampler-curve

Disable curve attribute samplers (default: Enabled) [v2.15.0]

--no-fx-attrsampler-eventstream

Disable event-stream attribute samplers (default: Enabled) [v2.15.0]

--no-fx-attrsampler-image

Disable image attribute samplers (default: Enabled) [v2.15.0]

--no-fx-attrsampler-imageatlas

Disable image atlas attribute samplers (default: Enabled) [v2.20.0]

--no-fx-attrsampler-grid

Disable grid attribute samplers (default: Enabled) [v2.19.0]

--no-fx-attrsampler-shape

Disable shape attribute samplers (default: Enabled) [v2.15.0]

--no-fx-attrsampler-text

Disable text attribute samplers (default: Enabled) [v2.15.0]

--no-fx-attrsampler-vectorfield

Disable vector-field attribute samplers (default: Enabled) [v2.15.0]

--no-fx-renderer-billboard

Disable billboard renderers (default: Enabled) [v2.15.0]

--no-fx-renderer-ribbon

Disable ribbon renderers (default: Enabled) [v2.15.0]

--no-fx-renderer-mesh

Disable mesh renderers (default: Enabled) [v2.15.0]

--no-fx-renderer-triangle

Disable triangle renderers (default: Enabled) [v2.15.0]

--no-fx-renderer-decal

Disable decal renderers (default: Enabled) [v2.15.0]

--no-fx-renderer-light

Disable light renderers (default: Enabled) [v2.15.0]

--no-fx-renderer-sound

Disable sound renderers (default: Enabled) [v2.15.0]

Resource optimizer pass

--res-opt
--no-res-opt

Enable/disable resource optimization (default: ON)

--res-dre
--no-res-dre

Dead resource elimination (default: ON)

Instruction optimizer pass

--ins-lsf
--no-ins-lsf

Load-store forwarding (default: ON)

--ins-cpr
--no-ins-cpr

Copy propagation (default: ON)

--ins-cfl
--no-ins-cfl

Constant folding (default: ON)

--ins-cfl-aggressive
--no-ins-cfl-aggressive

Constant folding, aggressive (default: ON)

--ins-cse
--no-ins-cse

Common sub-expression elimination (default: ON)

--ins-icb
--no-ins-icb

Instruction combining (default: ON)

--ins-vrp
--no-ins-vrp

Value-range propagation (default: ON) (new: v2.3)

--ins-dce
--no-ins-dce

Dead code elimination (default: ON)

--ins-dce-aggressive
--no-ins-dce-aggressive

Dead code elimination, aggressive (default: ON)

--ins-fcmpulps=<n>

Number of ULPs below which two floating-point values are considered the same, when performing constant-folding fuzzy compares (default: 2) [v2.7.0]
This can be seen as an "epsilon" value, used test values against specific constants such as 0.0 or 1.0 to perform instruction simplifications.
Set to zero to disable.
Ex: --ins-fcmpulps=64

Storage optimizer pass

--sto-lsm
--no-sto-lsm

Load-store path merge (default: ON)

--sto-cfl
--no-sto-cfl

Constant folding (default: ON)

--sto-csd
--no-sto-csd

Constant storage detection (default: ON)

--sto-csr
--no-sto-csr

Constant storage removal (default: ON)

--sto-vrp
--no-sto-vrp

Value-range propagation (default: ON)

--sto-vrp-changes=<n>

Maximum number of times a storage value-range limit can be modified before being bumped to max-range (default: 4)
Ex: --sto-vrp-changes=8

--sto-vrp-passes=<n>

Maximum number of storage value-range propagation passes (default: 16)
Ex: --sto-vrp-passes=4

--sto-rsr
--no-sto-rsr

Redundant storage removal (default: ON)

--sto-usr
--no-sto-usr

Unused storage removal (default: ON)

--sto-lsr
--no-sto-lsr

Load-store path removal (default: ON)

--sto-urr
--no-sto-urr

Useless renderer removal (default: ON) [v2.7.0]
Removes all renderers whose Enabled pin has been constant-folded to false

--sto-fto
--no-sto-fto

Fixed-time optimization (default: ON)

Payload optimizer pass

--pld-opt
--no-pld-opt

Enable/disable payload optimization (default: ON)#

Global effect optimizer pass

--geo-dlr
--no-geo-dlr

Disconnected layer removal (default: ON)

--geo-ulr
--no-geo-ulr

Useless layer removal (default: ON)

--geo-vrp
--no-geo-vrp

Value-range propagation on event payloads (in and out of layers) (default ON)

--geo-vrp-changes=<n>

Maximum number of times an event value-range limit can be modified before being bumped to max-range (default: 4)
Ex: --geo-vrp-changes=8

--geo-vrp-passes=<n>

Maximum number of event value-range propagation passes (default: 16)
Ex: --geo-vrp-passes=4

--geo-passes=<n>
--no-geo-passes

Number of global effect optimization passes (default: 4)
Ex: --geo-passes=2

Previewing compiler-switches in-editor

You can specify custom compiler switches in the project settings, under the Editor > General category.
These will be used by the effect editor & content-browser when compiling & analyzing assets, and can be different from the ones used during baking specified in the .pkcf bake config file.
For example, you can use that to modify warnings/errors, ignore specific warnings in the content-browser, etc:
Project commandline switches
These can in turn also be overridden per-user in the editor preferences under the Content editor > Effect Editor category:
User commandline switches

Example

Here is an example of a possible setup in the config file:

COvenBakeConfig_Particle $00001234
{
    BakeTarget = "Desktop";
    CompilerSwitches = "--geo-passes=6";
    BackendCompilers = {
        $00000042,
        $00000043,
    };
}
COvenBakeConfig_ParticleCompiler $00000042
{
    Target = D3D11;
    BakeBytecodeCommandLine_Windows = "\"{FXC}\" -T cs_5_0 -E Root -WX -Ges -O3 -nologo -Fo \"$(TargetPath)\" \"$(InputPath)\"";
}
COvenBakeConfig_ParticleCompiler $00000043
{
    Target = D3D12;
    BakeBytecodeCommandLine_Windows = "\"{FXC}\" -T cs_5_1 -E Root -WX -Ges -O3 -nologo -all_resources_bound -Fo \"$(TargetPath)\" \"$(InputPath)\"";
}

This will also compile the GPU sim bytecodes for the D3D11 and D3D12 backends, and store them in the baked pkfx.
Without this step, the GPU sim will have to compile the bytecodes on the fly at load time, which is not always possible depending on the platform, and which you most likely do not want to do considering how slow it is to compile with fxc.