GPU dist. field collisions -- errors

Hey folks!

Seeing some weird behavior with GPU distance field collisions in Niagara. It sorta works… but not always. Collisions are detected very inconsistently for some meshes, and I’m not sure why – in many cases, particles pass through surfaces and/or get stuck inside them.

I checked the global distance field itself using the viewport visualizer, and while some meshes are very low detail, there does seem to be valid information for things for which collisions are not happening.

My particles aren’t moving very quickly, so it doesn’t look like an undersampling thing.

One thing to note is I’m using this in a decent size scene: it’s a map with a chunk of a city. Most of the demos I’ve seen are much smaller. But, I can’t think of a specific reason why the scale would be relevant – the particles are going through the sides of buildings which are flat.

Anyone experienced this, and is there anything I can tweak to fix it?


GPU distance fields shouldn’t be used if perfect accuracy is required from the colllsions.

Sampling happens on the global distancefield, which due to preformance reasons, loses detail when further away from the camera.

This can cause items which are thinner than the resolution at that distance, to no longer be accounted for.

I think you can go in the static mesh settings and increase the resolution of specific meshes, however that will increase memory footprint quite significantly.

Yeah, it’s definitely approximate, but it should work better than it is. Little details won’t work; but the side of a building should.

The distance thing is fine since the particles will be culled anyway.

Seems like there’s something wrong with the collision module. The avoid GPU module mostly works. And I can sample the distance field and display it with particles. Something about how it computes collisions is weird, though…


Maybe the whole motion prediction thing just doesn’t make sense with GPU collisions… hmm…

Well, there’s a huge update coming in 4.27. Unfortunately, we can’t upgrade right now. Ugh.

For me DF collision works perfectly fine, on 4.26. You could try to increase your particle collision size. In addition you can lower the Global Distance Field Size/Scale/Range (can’t remember what it’s called exactly) in the World Settings. Lowering it increased the precision for me in the foreground.
Also be aware that sometimes you’ll have large objects in your scene, e.g. a ground plane, which can affect your Global Distance Fields in weird ways.

1 Like

Haven’t tried the size/scale/range idea… I’ll see if I can find it.

This technique is very context dependent. I’m trying to use it in a city-ish sort of map with lots of objects. Has lots of trouble with ground surfaces, in particular. But sure, with some tweaking, I can get it to work in many cases.

With what use cases has this been successful for you?

Ah! Figured out the problem: the global distance field (and presumably mesh distance fields) are designed to work with geometry at unit scale. If the scale transform on a static mesh actor is anything other than [1,1,1] it distorts the distance fields.

In my case, artists had been blocking out parts of a level using basic cubes they had scaled to various proportions. That broke the distance field. The solution is to import geo at unit scale, or modify the static mesh build settings – increase the build scale to match what it’s meant to be in world-space, and set the actor transform scale to [1,1,1].

1 Like

Glad you were able to solve your issue! That’s usually best practice anyway. You tell em’! :smile: