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]


Steps to Reproduce
  • Open the Editor and enable the NiagaraFluids plugin
  • Create a new Niagara System based on template "Grid 3D Gas Explosion"
  • In the "User Parameters" tab, edit "WorldSpaceSize" by deleting the first digit of any component
  • The GPU will hang, the video driver will be reset by the OS, and the Editor will crash

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-213356 in the post.

Login to Vote

ComponentUE - Niagara
Affects Versions5.3.2
Target Fix5.4
CreatedApr 26, 2024
ResolvedMay 8, 2024
UpdatedMay 9, 2024