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:
|
Endianness | LittleEndian | Only used when ‘BakeMode’ is set to ‘Binary’. Can be any of the following:
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
|
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 optimization 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) |
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 |
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 |
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.