The NiagaraFluids plugin provides several Niagara System templates to use as a starting point for the user's own Systems. The templates in category "3D Gas", such as "Grid 3D Gas Explosion", include Emitters that make use of the function "Grid3D_SetResolutionBasic". This function, in turn, receives an input "WorldGridExtents" that linked to the User Exposed Parameter "WorldSpaceSize".
When input "WorldGridExtents" of function "Grid3D_SetResolutionBasic" has one or more components with a very small value, the function can output a grid with 0 cells in the corresponding dimension. Further ahead in the simulation, this results in a GPU hang which crashes the engine and may even freeze the user's computer to the point of needing a hard reboot.
This issue becomes specially important because the Niagara Editor reacts in realtime to partial edits in the values displayed in the "User Parameters" tab. This means that, if a user attempts to edit a component of the vector "WorldSpaceSize" by first deleting its current value and then typing in a new value, the System will momentarily attempt to simulate with a dimension value of 0.0, resulting in the crash.
One way to deal with this issue would be to guard function "Grid3D_SetResolutionBasic" from invalid "WorldGridExtents" values. This can be done, for example, by adding the following lines to the end of the "Custom HLSL" node in the beginning of the function:
(...)
if (NumCellsX <= 0) NumCellsX = 1;
if (NumCellsY <= 0) NumCellsY = 1;
if (NumCellsZ <= 0) NumCellsZ = 1;
Out_WorldGridExtents = float3(NumCellsX, NumCellsY, NumCellsZ) * CellSize;
Note: This is not a duplicate of [Link Removed]
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-213356 in the post.
0 |
Component | UE - Niagara |
---|---|
Affects Versions | 5.3.2 |
Target Fix | 5.4 |
Created | Apr 26, 2024 |
---|---|
Resolved | May 8, 2024 |
Updated | May 9, 2024 |