Particle values can be inspected by using PopcornFX Editor’s particle debugger.
All renderers support selection in the viewport (draw a selection rectangle with the mouse) and are rendered in wireframe when selected.
When selecting particles with the viewport paused, the debugger automatically captures and displays all values for selected particles (the currently debugged particle is displayed in red).
Captured values are displayed for each pin where available in the graph containing the selected particles (layer containing the selected renderer).
- Captured values are displayed in the graph when available (evolve only)
- Allows cycling between debugged particles
- Pausing the viewport is required
- Selected/debugged particles are drawn in wireframe with the currently debugged particle outlined in red
- The Editor mode is required to debug particles
The debugger supports debugging for CPU and GPU simulated particles.
Compute shaders for GPU particle graphs are augmented with debugger specific code in order to capture GPU particles data. Debugger specific compute shaders contain a lot more instructions. This can lead to:
- The shader compiler (DXC, FXC) taking too much time to compile the shader causing PK-Editor to detect the compilation task to have timed out. This is particularly the case with the D3D11 GPU simulation compiled with DXC.
- The shader compiler itself not being able to compile the debugger compute shader(s)
You can expect a PopcornFX Editor freeze when selecting GPU particles. Its duration can be up to the shader compiler timeout time, specified in your user settings.
Once the editor becomes responsive again, if no values are displayed in the graph, this usually means the debugger compute shaders could not be compiled or timed out, so the debugger won’t work.
We recommend to increase the timeout to 5000ms (5 seconds):
We plan in future PopcornFX Editor versions to schedule debugger compute shaders compilation on asynchronous tasks to avoid freezing the editor.
- Only evolve values are captured. It is not currently possible to debug particle spawn data.
- Capturing values in Shipping will not work, make sure to be in Editor mode (specified in the viewport’s toolbar)
- GPU particles can be debugged, increasing the shader compilation timeout is recommended
Asserts are a powerful debugging tool allowing to break PopcornFX simulation when a condition is not met. Assertion nodes can be placed in the graph with values evaluated per-particles.
When the simulation is paused, particles that did not meet the assert conditions are automatically captured and selected in the viewport.
Similarly to assertion nodes, Error nodes can be used and produce the same result, however the condition is inverted:
Debug check nodes can be placed in custom templates to sanitize their usage by VFX artists.
- Assertion and Error nodes currently have no effect when used by GPU particles or when in Shipping.