1. Home
  2. Docs
  3. PopcornFX v2.3
  4. Baking
  5. Resource ovens
  6. Oven: Particle

Oven: Particle

COvenBakeConfig_Particle

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

Property nameDefault valueDescription
All common properties, see COvenBakeConfig_Base
BakeModeBinaryCan 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
EndiannessLittleEndianOnly 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.

RemoveEditorNodestrueIf 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"
};
CompiletrueWhen enabled, will compile all layers into runtime IRs and store them in the effect file.
RemoveSourcetrueWhen 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 nameDefault valueDescription
TargetCPUSpecifies 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)
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:
 

--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
General optimization control
-O0No optimizations
-O1Instruction optimizations enabled, no storage or global effect optimizations (similar to editor’s ‘Editor’ optimization level)
-O2All optimizations enabled, user debug not removed (similar to editor’s ‘Shipping’ optimization level)
-O3All 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)
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, agressive (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, agressive (default: ON)
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-vrp
--no-sto-vrp
Value-range propagation (default: ON) (new: v2.3)
--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-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-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.
 

Still stuck? Contact us
Was this article helpful to you? Yes No

How can we help?