Can Niagara emit particles from a mesh volume

Kinda weird, that so far I know you can’t do it.
For example in blender it`s super easy to do.

1 Like

Absolutely:

yeah thats not what I am looking for. This video is about particles along the mesh surface, but I want particles in a mesh volume.

Well, something you can do, is hack the static mesh location module ( copy it ), and follow the mesh normal back a random amount. That will do it.

Thats sound like a great Idea, thanks.

Definitely possible. If you get stuck, just say, and I’ll take a look…

In the Skeletal Mesh Location Module, I found a “offset position along sampled normal” parameter. On this parameter I use a “Uniform AOr BFloat” and make the A value a random(how far it follows the mesh back on the normal).
But thats also not really the result I am looking for, because at the example crow picture, you can see that at the beak and feet it is fine, but the belly area has a bigger volume and it looks a little bit thin.

I guess I look into blender, maybe I find how they calculate the points in the mesh volume.

You might also try putting that module in the update section… Only make a difference if you’re using a spawn rate.

Bumping this as I have the same question. Is there any confirmed ways to make particles sample mesh volume instead of tri?

No, Niagara can only sample the mesh surface or distance field for now, so there is no easy way to uniformly spawn inside a mesh.

You can sort of hack it together yourself with the above approach. Another possibility would be to do some rejection sampling, just spawn particles in a grid, then each particle checks if it’s inside the mesh or not - but to get narrow features like the spider legs with this you would need to spawn a lot of particles, so it always depends on your use case.

2 Likes

Thank you so much for your reply.

In this stream Jon said he used distance field to create volumetric representations of the kernel’s limbs, then pack it with particles. But distance field is still a representation of the surface instead of the volume of the limbs correct? I’m wondering how he did it?

40:27 - 41:12

The distance field query returns a positive distance if it is outside a mesh and a negative distance if it’s inside a mesh.

You can easily verify it with a scratch pad like this:

3 Likes

Thanks for the pointer. I was able to make it work!

5 Likes

This looks cool, could you post your blueprint or emitter setup? :slight_smile: I think, several would love to have this too (and mabe this should be integrated into UE as a standard emitter, with that being available for all).

1 Like

I’m just modifying the existing Niagara System located in Content Example

ContentExamples/Content/ExampleContent/Niagara/NeighborGrid3D/StructuralSupport/StructuralSupport

and plugged in the code provided by @Michael.Galetzka, set a bool for the to-be-killed particles. And then adding a Kill Particles action.

image

I’m still trying to achieve the same thing as the demo to make a particle-filled actor that moves with skeletal meshes. It’s not a straight forward process as skeletal meshes don’t produce mesh distance field, so one would have to first make a cut-up static mesh, then fill the limbs individually so each emitter can be assigned to follow a bone later on.

3 Likes

That distance field function samples the Global distance field, not a specific mesh’s, so any mesh within the bounds of your spawning box/grid will also apply.

Would be really great to have a proper volume spawner for shaping spawn areas, so we could use meshes with DF and collision turned off (so they don’t cause problems with other systems, like DF based shadows).

Would be cool to be able to sample the Distance Field of only target meshes, but you can always generate a custom Volume Texture DF outside of Unreal

1 Like

I am trying to achieve the same thing. I could not replicate what you did here @Chacobo. Would you mind sharing some more details or the file?
I am looking for the same same result with skeletal mesh moving. Did you manage to make it work with an actor that moves? Thank you