I would like my niagara gpu particle to collide with landscape mesh, and so far I haven't been able to do it with gpu distance field mode, only depth buffer mode works.
I checked the mesh distance field visualizer and indeed it is black in the buffer for landscape: is there any way to enable mesh distance field generation for landscape??
Replies
It sounds like landscape's distance field is limited to DFAO calculation as it's based off the heightmap:
https://docs.unrealengine.com/5.1/en-US/distance-field-ambient-occlusion-in-unreal-engine/#landscapes
You might be able to see the landscape's distance field representation through the global distance field viewport visualizer, but judging by how it's calculated based on this article's info, that might be the reason why it's not available for collision sampling within Niagara:
hhttps://docs.unrealengine.com/5.1/en-US/mesh-distance-fields-in-unreal-engine/#globaldistancefield
(I haven't worked with landscapes and niagara distance field collision though, so take this all with a grain of salt!)
You should be able to see the landscape in the global distance field
4.26 and up has a virtual heightfield - I'm not sure if that does anything different but it might be worth a poke.
Thx @poopipe @cathodeyolk
So I went back to this question today, and yes if I fly very close to the landscape with global distance field enabled, I do see the field and niagara particle does collide with it
Of course, my problem is I am much farther away from landscape, almost in a RTS top-down view kinda distance. I wonder if there is a landscape specific parameter to increase its distance field resolution?
There's a global parameter for resolution - that comes at a cost obviously.
Iirc you have to set it in one of the cfg files
yeah that's probably not the best idea. I might use a proxy mesh for landscape and then try to adjust its mesh distance field resolution threshold instead. global distance field is too coarse for this kind of usage.