Unreal 5.2 Emit from Texture

Anyone know of an easy way (easy being relative I guess) to spawn particles from a texture?

I followed this tutorial but this really isn’t what I want. This basically creates a grid of particles and then colors them from the texture sample.

I want to actually JUST emit from the white parts of the texture (or any color really as long as I can control where it’s emitting from)

I can’t speak for others, but this is pretty much how I do it. The only extra thing I generally do is to kill the particles which will not be visible by checking if the value of any tex color channel is below certain threshold. There is an aptly named module “kill particle” then do a “bool from float comparison”.

Also there is no need to sample the texture in Particle Update. Sampling the texture, applying the tex color on the particles and killing the invisible particles can all be done in Particle Spawn which can improve the performance somehow.

Is this all done through scratchpad?

I’m just learning the scratchpad stuff so not quite to the point that I can construct things on my own just yet.

In this specific case the scratch pad can be avoided, but you would end up exposing what is done in the scratch pad back to the emitter stack which may look a bit messy and unorganized if you stick with the default dynamic inputs. You can use a “custom expression” if you are familiar with HLSL/C-like syntax:
float3(Particles.ParticleUV * 500, 0) + float3(-250,-250,0)
But the problem is the 2 other input parameters involved (“Add Vector” and “Scale”).

Again, you can’t really order a particle to be spawned at a specific texture pixel. The Shape Location module uses mathematical methods to assign particles to specific locations of any primitive shape. But because a raster image can be anything totally random, it can’t be easily or efficiently described in mathematical terms.

1 Like

I know Im very late to this thread but have you tried using the Sample Rejection that exists in the Sample Texture node in Niagara, its right at the very bottom of the stack in the node details. I have only just found this and it appears to do what you’re wanting to do, it uses a comparison to kill from areas based on brightness. Probably just does the same as a Kill node with a bool tbh but appears to offer another way of doing out the box.

This is what the tool tip says:

2 Likes

This is awesome thanks for the post I’m going to go check it out now

1 Like