# How to set spawn location in Niagara using a alpha texture?

**URL:** <https://forums.unrealengine.com/t/how-to-set-spawn-location-in-niagara-using-a-alpha-texture/149976>\
**Category:** FX\
**Tags:** unreal-engine\
**Created:** [August 30, 2020, 4:30am UTC](https://forums.unrealengine.com/t/how-to-set-spawn-location-in-niagara-using-a-alpha-texture/149976 "2020-08-30T04:30:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JimmothySanchez](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JimmothySanchez](https://forums.unrealengine.com/u/JimmothySanchez)\
**Post date:** [August 30, 2020, 4:30am UTC](https://forums.unrealengine.com/t/how-to-set-spawn-location-in-niagara-using-a-alpha-texture/149976/1 "2020-08-30T04:30:49Z")

</div>

So want to be able to feed a black and white image to a Niagara system and have the starting location of the particles correspond to the white areas of the image. So for instance I could feed the Niagara system the Unreal U logo and have it spawn particles so that they for a U. Has anyone done something similar to that? I’d like to be able to randomly spawn them anywhere along the white areas of the image as opposed to just being a grid. I’ve thought about just spawning them everywhere and then just killing the particles that fell outside the area that I wanted. That solution seems more straightforward to me, but i can’t really get that to work either.

Anyone have any ideas?

---

<div class="post-metadata">

**Author:** ![JimmothySanchez](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JimmothySanchez](https://forums.unrealengine.com/u/JimmothySanchez)\
**Post date:** [September 3, 2020, 3:19pm UTC](https://forums.unrealengine.com/t/how-to-set-spawn-location-in-niagara-using-a-alpha-texture/149976/2 "2020-09-03T15:19:17Z")

</div>

So I have this working a little bit, I created a new Niagara Module that converts the particle’s world position to uv space and samples the texture’s value at that position and kills it if it’s not over some threshold. Then I just put that down the line from a box location module and set the particle spawn rate real high.

This kind of works but is far from an ideal solution. I’m doing this on a very large scale and the nature of my image is such that there is way more black pixels in the image than white. Which means I have to set the spawn rate ludicrously high because 90% of my particles are just getting killed off. If there was a solution that instead of just killing of particles in the wrong place would let me move them to a random valid location that would help me a lot. I’m open to any suggestions.

---

<div class="post-metadata">

**Author:** ![hGosling](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@hGosling](https://forums.unrealengine.com/u/hGosling)\
**Post date:** [December 2, 2021, 10:11pm UTC](https://forums.unrealengine.com/t/how-to-set-spawn-location-in-niagara-using-a-alpha-texture/149976/3 "2021-12-02T22:11:49Z")

</div>

Have you ever fixed this? I am facing a similar problem. I have just a small region where I need high density of psrticles. Spawning all over my mesh and then killing by slpha channel is a real Performance killer
