Potential wrong branch condition about DFAO and Niagara GPU SDF Collision

Hi there,

When I turn off the DFAO in 5.7, it will not only turn off the AO function but seems to disable the whole Global Distance Fields system, which leads to wrong collision when using Niagara GPU particles with ‘GPU Distance Fields’ collision option.

There is a similar feedback in 2025, see this link:

And the official modification about this issue are Fix incorrect rendering of materials that require global distance field when using Path Tracing.

and Merged distance field streaming operations into one invocation for all scene renderers and removed distance field methods from FSceneRenderer.

I believe this is because the branch condition in DistanceFieldAmbientOcclusion.cpp, line 772 is probably wrong, considering a level where megalights, lumen, path tracing, debug draw are all turned off, then as the code logic the SDF is only controlled by DFAO itself, so when DFAO is off, the SDF is off. When DFAO is off, there is noway to turn on Niagara GPU SDF collision but to turn on path tracing(bShouldPrepareForMaterialsOrNiagara), but path tracing is not supposed to be relevant with the Niagara system here.

I am not sure about it, but maybe the flag bShouldPrepareForMaterialsOrNiagara should outside the branch condition.

Looking forward to your reply, and sincerely thank you for the clarification!

[Attachment Removed]

重现步骤

  1. Open a blank 5.7 project
  2. Place any type of shape and set its collision mode to ‘block all’
  3. Place a fountain niagara system above the shape
  4. Adjust the niagara system to GPU simulation, and add a collision module to it, remember to set collision mode into ‘GPU Distance Fields’
  5. Be sure the project does not open ‘Path Tracing’ and then use console command ‘r.DistanceFieldAO 0’ to turn off the DFAO function.
  6. You’ll see the particles fall straight through the shape you’ve placed, that is to say the collision is wrong, but the AO function is not supposed to be relevant with GPU SDF collision.​
    [Attachment Removed]

Hello,

Thank you for reaching out.

I’ve been assigned this issue, and we will be looking into Niagara Particles loosing collision in this situation for you.

[Attachment Removed]

Hello,

Thank you for reporting this. I can confirm this issue can be reproduced as described in the latest CL, and will open a bug report.

We will reply with a public tracker when one is available.

[Attachment Removed]

Hello,

Here is the public tracker for the issue:

https://issues.unrealengine.com/issue/UE\-368942

If you have any further questions, please let us know.

[Attachment Removed]