Niagara gpu distance field collisions don't work?

I’m trying to set up a niagara system. The collisions won’t work.

  1. Distance Field enabled in project.
  2. Particles are set to gpu.
  3. Collision is set to gpu distance fields.
  4. Collision is enabled.
  5. Kill event hooked up to on collision.

Nothing happens and the system plainly goes through walls, floors, players and any geometry,

The level geometry is made of HISMs but they still don’t work with normal static meshes; in play or editor.

Any help appreciated, thanks.

1 Like

Like anything else in computer graphics, Niagara has no concern of artistic goal.
The functions in Niagara are take an action-oriented perspective to particle lifecycle, usually requiring multiple functions to achieve a single artistic requirement. (Such as particles dying when occluded)

To describe an issue with Niagara, it would be best to provide a end-to-end of what/how you expect Niagara to handle a single particle in all your desired situations. (Do a breakdown of the system, from spawn to death, and under what conditions either state should be triggered/avoided)

I will answer for now based on what I understand is your situation, but I will update my answer if you come back with more detail.
Along with some more detail, could you link a picture of what the stack for your Niagara System looks like?

There are a few ways to make particles die when they hit an object. Depending on your needs, a simple solution might be to enable the [Age Colliding Particles] → [Advanced Aging Rate] setting, found in the Collision module in you Particle Update stage. If you provide a sufficiently large number, your particles will advance past their lifespan upon collision.

Aside from the Distance Field setting you mentioned, I have never needed to adjust any settings outside of the Niagara Systems I build.
Given your focus on collision not function correctly, I’ve attached a screenshot of a working water jet effect. Hopefully this might help you check if maybe you are missing something.

You must have a Collision module in the Particle Update stage, and it must be immediately precede a “Solve Forces and Velocity” Module. Together, these modules should be last in the Particle Update stage.
Aside from that info, don’t assume I am taking the best approach to the effect your looking for, but the pictured setup does work for me and correctly collides with the world.
I have two “Solve Forces and Velocity” modules, one for world/particle effect physics and the other for collision physics. The settings for these modules are shown on the right-side of the screen shot.

I use this setup because the additional info for Collision Modules states that “Write to Intrinsic Properties” should only be True where CollisionValid == true, but using a single Solve Force module and tying the transient CollisionValid variable to this property seems to prevent some modules from manipulating particle velocity unless a collision is occurring.

------- Original Answer ---------

If you are trying to make particles spawn-on and stick-to walls that are only visible to the player, I would say that you are on the right track by using depth buffer operations.
These operations typically allow you to have a particle’s location interact with opaque surfaces in the viewport.
This might not be what you want if you are building a FPS game where the player has visible meshes, such as guns or hands, attached to the camera/viewport, as particles might interact these meshes undesirably.

If you are trying to have moving particles die upon leaving the bounds of a level (say for example: You have a Niagara system attached to the viewport, and the player turns against a wall, particles should not return from behind the wall), you may want to look at settings/functions in Niagara that handle occlusion, culling, and killing particles.

If you trying to have particles interact with general physics, such as bumping into walls and meshes, functions and settings that interact with the depth buffer might not be simplest or best solution, but this really depends on what your particle looks like and complexity of your scenario.
For example, if you are using a Sprite Renderer at the bottom of your Niagara system, you will likely fight with the direction the particle Sprites is facing. When placing Sprites by depth buffer operations alone, they will clip into non-parallel surfaces/geometry, because Sprites do not have a mesh to define their collision body.
Depending on the scale/count of your desired Niagara System, it might be easier/simpler to use the Mesh Renderer instead of the Sprite Renderer, as this will give your particles a defined body.

Hope this helps somehow!

I don’t understand what you mean. If I have collision set up with mesh distance fields with a collision event to kill when a collision happens then that is an apt description, no?

Again, I don’t understand what you mean. Niagara is not that complex(at least in blueprints). By merit of it having a collision setting enabled with a radius for the particles should be enough, no? Cascade can handle it in similar fashion and I was under the impression that niagara was just cascade but better?

And I just have a system that is like a water jet, when it hits a wall I want it to kill but instead it goes right through walls.

Particles going through meshes means somewhere along the way the collisions aren’t working

I have not worked with Chaos myself, but I have read elsewhere that Niagara has similarities with Chaos.
Apologies, I did not mean to sound vague. Not everyone cares to understand how combustion works before they go about modifying their car, and some people are just looking for a push in the right direction.
Providing clear definition/example of the how the system is failing just helps to understand that you are looking for a specific answer to a specific issue.

I’ll update the answer with some more info that might help.

Please feel free to post back if you are still having trouble with this, I am interested to know what the culprit is here.
Maybe try dialing back on your overall Particle Velocity if nothing else helps. I do not know the order of operations used by the engine when solving collision geometry and Velocity, but maybe this could be the issue if you mean a literal JET of water?

The engine does not always handle collisions how you expect…
One I find surprising is if you take the basic FPS template and replace the floor with the built-in single-sided Plane mesh, the cubes like to become ethereal if you slide them across the floor, but the player capsule has no issue.

I would think that 180km/h (-5000m/s) Gravitational force is not what you are really need on these particles?
Drag, Acceleration, and Mass. These dictate the terminal velocity of an object governed by real life physics, which is what Unreal Engine tries to replicate.
If you really need the particles to fly that fast (maybe you do!), have you tried asjusting the Mass and reducing Drag to see if you can lower that Gravity?

Why?
Physics in Unreal Engine are assessed on a tick-based interval, which by default is roughly linked to the Render tick.
As a sanity check, turn the projectile velocities down and see if they still penetrate other meshes. If they don’t, or it’s too tough to test, you can try two things:
(Not 100% on the setting names, I’ll try this stuff out later)

I̶n̶ ̶y̶o̶u̶r̶ ̶p̶r̶o̶j̶e̶c̶t̶ ̶s̶e̶t̶t̶i̶n̶g̶s̶,̶ ̶t̶h̶e̶r̶e̶ ̶i̶s̶ ̶a̶n̶ ̶o̶p̶t̶i̶o̶n̶ ̶f̶o̶r̶ ̶P̶h̶y̶s̶i̶c̶s̶ ̶S̶u̶b̶ ̶S̶t̶e̶p̶p̶i̶n̶g̶ ̶(̶o̶r̶ ̶F̶r̶a̶m̶i̶n̶g̶?̶)̶.̶ ̶ ̶Y̶o̶u̶ ̶s̶h̶o̶u̶l̶d̶n̶’̶t̶ ̶n̶e̶e̶d̶ ̶t̶o̶ ̶a̶d̶j̶u̶s̶t̶ ̶t̶h̶e̶ ̶d̶e̶f̶a̶u̶l̶t̶ ̶v̶a̶l̶u̶e̶s̶ ̶m̶u̶c̶h̶.̶ ̶ ̶A̶d̶j̶u̶s̶t̶i̶n̶g̶ ̶t̶o̶o̶ ̶m̶u̶c̶h̶ ̶c̶o̶u̶l̶d̶ ̶b̶e̶ ̶u̶n̶f̶e̶a̶s̶i̶b̶l̶e̶ ̶d̶u̶e̶ ̶t̶o̶ ̶t̶h̶e̶ ̶p̶e̶r̶f̶o̶r̶m̶a̶n̶c̶e̶ ̶h̶i̶t̶,̶ ̶b̶u̶t̶ ̶i̶t̶ ̶d̶e̶p̶e̶n̶d̶s̶ ̶o̶n̶ ̶y̶o̶u̶r̶ ̶s̶i̶t̶u̶a̶t̶i̶o̶n̶.̶ Edit: No noticeable impact for this situation when I tested it

E̶n̶a̶b̶l̶e̶ ̶C̶o̶n̶t̶i̶n̶u̶o̶u̶s̶ ̶C̶o̶l̶l̶i̶s̶i̶o̶n̶ ̶D̶e̶t̶e̶c̶t̶i̶o̶n̶ ̶(̶C̶C̶D̶)̶ ̶o̶n̶ ̶t̶h̶e̶ ̶N̶i̶a̶g̶a̶r̶a̶ ̶S̶y̶s̶t̶e̶m̶.̶ ̶ ̶I̶f̶ ̶t̶h̶i̶s̶ ̶s̶e̶t̶t̶i̶n̶g̶ ̶i̶s̶ ̶p̶o̶s̶s̶i̶b̶l̶e̶/̶a̶p̶p̶l̶i̶c̶a̶b̶l̶e̶,̶ ̶i̶t̶ ̶w̶o̶u̶l̶d̶ ̶b̶e̶ ̶f̶o̶u̶n̶d̶ ̶o̶n̶ ̶t̶h̶e̶ ̶o̶b̶j̶e̶c̶t̶ ̶D̶e̶t̶a̶i̶l̶s̶ ̶t̶r̶a̶y̶/̶w̶i̶n̶d̶o̶w̶,̶ ̶l̶i̶k̶e̶ ̶w̶h̶e̶r̶e̶ ̶y̶o̶u̶ ̶c̶h̶a̶n̶g̶e̶ ̶m̶e̶s̶h̶ ̶m̶a̶t̶e̶r̶i̶a̶l̶s̶ ̶o̶r̶ ̶o̶b̶j̶e̶c̶t̶ ̶l̶o̶c̶a̶t̶i̶o̶n̶s̶.̶ Edit: Not directly applicable, nor inheritable from what I could tell
CCD is commonly used on projectiles when people are trying to simulate bullets with realistic velocities in Unreal Engine.

Search this page for “CCD”:
link text

These are my settings, even if I setup a blocking volume to all the particles go right through. Thanks for your help thus far.

Glad to hear you got it figured out!

I have not had an issue before with particle radius being too small, except near edges/corners.
For my own curiosity, and to clarify for others who might find this question in the future:
Were collisions failing more near the corners/edges of the receiving geometry, or through the center as well?

It was particle radius scale, I assumed .1(default size) would be big enough to be detected. Changing that to 5 makes the particle collide.

Thanks for your help

I just realized changing the sizes isn’t gonna work anyways as now that they are bigger from the .1 a lot of the particles are self colliding and killing. And the distance field collisions only seem to work depending on camera angle as well.

If I can’t see the particle collision and the entirety of the mesh it is hitting it just goes right through it.

Depth buffer and analytical planes do nothing.

The sized collisions were going through the entire mesh not corners/edges it didn’t matter where, I don’t even know if the size was the issue as I just found out camera angle apparently effects it as well.

I finally found some documentation that at least talks about this issue:
[Using Particle Collision Mode for Distance Fields][1]

I was able to reproduce this non-collision, using thin-bodied meshes (<30CM thick) and high-velocity particles (5000 cm/s), so I did some testing and fiddling.

I still cannot find any docs that cover how physics collisions are calculated using Distance Fields on the GPU, but I found a problematic correlation that could explain your issue.
When the axis of the object that received the collision was less than 1/10th of the size of the others (example being the 1M cube with scale [8,12,0.3]), collision gets fuzzy and eventually unachievable without scaling up the particle collision size.

Assuming that Niagara utilizes the same Distance Field that is used for lighting + AO.
I tried manually adjusting the Distance Field Resolution in the Static Mesh Editor for the receiving collision body, but this had no discernable/provable change. Edit: Not reasonably testable or provable

T̶h̶a̶t̶ ̶s̶a̶i̶d̶ ̶a̶c̶t̶u̶a̶l̶ ̶n̶u̶m̶b̶e̶r̶s̶ ̶d̶e̶f̶i̶n̶i̶t̶e̶l̶y̶ ̶v̶a̶r̶y̶,̶ ̶b̶u̶t̶ ̶I̶ ̶s̶u̶s̶p̶e̶c̶t̶ ̶i̶t̶’̶s̶ ̶c̶a̶u̶s̶e̶d̶ ̶b̶y̶ ̶s̶o̶m̶e̶ ̶s̶o̶r̶t̶ ̶o̶f̶ ̶c̶o̶l̶l̶i̶s̶i̶o̶n̶ ̶"̶c̶u̶l̶l̶i̶n̶g̶"̶ ̶o̶r̶ ̶r̶o̶u̶n̶d̶i̶n̶g̶ ̶e̶r̶r̶o̶r̶s̶ ̶w̶h̶e̶n̶ ̶p̶a̶r̶t̶i̶c̶l̶e̶s̶ ̶a̶r̶e̶ ̶t̶o̶o̶ ̶s̶m̶a̶l̶l̶ ̶f̶o̶r̶ ̶t̶h̶e̶ ̶r̶e̶c̶e̶i̶v̶i̶n̶g̶ ̶g̶e̶o̶m̶e̶t̶r̶y̶ ̶a̶n̶d̶ ̶t̶h̶e̶ ̶g̶i̶v̶e̶n̶ ̶v̶e̶l̶o̶c̶i̶t̶y̶.̶ Edit: It’s as if there is a threshold in size where velocity appears to make little impact. If an object is thin enough, even low velocity particles will travel through it if the collision radius is increased

To get the effect you need, you will have to find the right values for several properties. Some of these properties were discussed in the comments while trying to find the core issue.

I still don’t know the exact scenario your dealing with, so my input/advise is limited to general observations of the Niagara system that could be affecting your situation.

Using the following system, my particles do not appear to self-collide as you mentioned.
Even with a Particle Radius Scale of 50.0 and a Uniform Sprite Size of 5.0 (see, “quite large”) there was no apparent particle self-collisions.
I did have to move unrelated nearby objects in the scene because the particles were colliding with them. Maybe your particles were colliding with something else nearby too, like the floor or an object behind the emitter?
You could also try lowering the Uniform Sprite Size before increasing the Particle Radius Scale?

When using GPU rendering, if the emitter’s Fixed Bounds are not visible to the camera the Engine can choose not to render the emitter, causing the GPU to not draw the particles either.
This is why the UI forces you to specify Fixed Bounds after switching to the GPUCompute Sim Target.
Increasing the Fixed Bounds setting in the Emitter Properties so the emitter bounds are within view anywhere you want to see particles should fix this issue.

347749-samplefountainstack.png

I kept the effect as simple possible. Any settings that had their default values are collapsed, so the following screenshot only shows the settings that were marked as non-default by the UI.

Lastly, some of the stuff I mentioned in the comments proved to be inconsistent and will indicate accordingly.

Hi Bloodrunner2000, one question on this image please.
How do you added the Event Handler in the Fountain GPU based emitter, as we see in the image?
I have errors always because it seems that GPU emitters cannot work with Event Handlers yet.

Thanks for this clarification.
Best
Matias