# Niagara - Spawn particles on static mesh surface based on mask texture

**URL:** <https://forums.unrealengine.com/t/niagara-spawn-particles-on-static-mesh-surface-based-on-mask-texture/155126>\
**Category:** FX\
**Tags:** unreal-engine\
**Created:** [December 16, 2020, 4:36am UTC](https://forums.unrealengine.com/t/niagara-spawn-particles-on-static-mesh-surface-based-on-mask-texture/155126 "2020-12-16T04:36:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ClintonWalsh](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ClintonWalsh](https://forums.unrealengine.com/u/ClintonWalsh)\
**Post date:** [December 16, 2020, 4:36am UTC](https://forums.unrealengine.com/t/niagara-spawn-particles-on-static-mesh-surface-based-on-mask-texture/155126/1 "2020-12-16T04:36:36Z")

</div>

Hi,

Is it possible to spawn particles on the surface of a static mesh based on a mask texture? I have been able to spawn particles on the surface of a static mesh but I am having trouble only spawning them within the white areas of a mask texture (or killing the particles in the black areas). Does anyone know how to go about doing this?

Thank you

---

<div class="post-metadata">

**Author:** ![MostHost\_LA](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mosthost_la/32/907035_2.png) [@MostHost\_LA](https://forums.unrealengine.com/u/MostHost_LA)\
**Post date:** [December 16, 2020, 6:24am UTC](https://forums.unrealengine.com/t/niagara-spawn-particles-on-static-mesh-surface-based-on-mask-texture/155126/2 "2020-12-16T06:24:19Z")

</div>

Is the mesh in niagara or external to it?  
there can’t be a link between the 2 systems without a render target or something similar.

---

<div class="post-metadata">

**Author:** ![ClintonWalsh](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ClintonWalsh](https://forums.unrealengine.com/u/ClintonWalsh)\
**Post date:** [December 16, 2020, 7:56am UTC](https://forums.unrealengine.com/t/niagara-spawn-particles-on-static-mesh-surface-based-on-mask-texture/155126/3 "2020-12-16T07:56:28Z")

</div>

The mesh is in niagara

---

<div class="post-metadata">

**Author:** ![MostHost\_LA](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mosthost_la/32/907035_2.png) [@MostHost\_LA](https://forums.unrealengine.com/u/MostHost_LA)\
**Post date:** [December 16, 2020, 7:05pm UTC](https://forums.unrealengine.com/t/niagara-spawn-particles-on-static-mesh-surface-based-on-mask-texture/155126/4 "2020-12-16T19:05:57Z")

</div>

If its in niagara, why not use something like vertex paint? A little easier to create stuff around it.

as far as regions there’s this.

> **[How do I use sampling regions?](https://forums.unrealengine.com/questions/943250/how-do-i-use-sampling-regions.html)**
>
> I want to control the rate at which particles are released or released only in certain parts of the skeleton mesh in Niagara. I think that’s the tab Sampling Region. How should I use it? I don’t know where to make the filter.

To sample the color you would still need to write your own code that reads the texture information.

I believe the reason this doesn’t just exist is that reading pixels from a texture is expensive.

---

<div class="post-metadata">

**Author:** ![ClintonWalsh](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ClintonWalsh](https://forums.unrealengine.com/u/ClintonWalsh)\
**Post date:** [December 16, 2020, 7:46pm UTC](https://forums.unrealengine.com/t/niagara-spawn-particles-on-static-mesh-surface-based-on-mask-texture/155126/5 "2020-12-16T19:46:50Z")

</div>

Unfortunately, I cannot use vertex paint because the meshes I would paint on are HLODs spawned from a blueprint and vertex painting does not to work on those.

I think the sampling regions section is only for skeletal meshes since I cannot find it in the static mesh editor.

I am trying to get moss on top of the rocks that I spawn in the blueprint. I think I will try to spawn moss clumps when I spawn the rock in the blueprint.

Thank you for your help

---

<div class="post-metadata">

**Author:** ![osiris\_dev](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/osiris_dev/32/88710_2.png) [@osiris\_dev](https://forums.unrealengine.com/u/osiris_dev)\
**Post date:** [December 17, 2020, 2:44pm UTC](https://forums.unrealengine.com/t/niagara-spawn-particles-on-static-mesh-surface-based-on-mask-texture/155126/6 "2020-12-17T14:44:11Z")

</div>

You can do that, just need to create Niagara Module Script for that.

 ![masked_static_mesh.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/7/7/77bb2e8a272f827b1a0cf4a7b18d8d2ceaff9ef5.png)

---

<div class="post-metadata">

**Author:** ![DatDopeDan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DatDopeDan](https://forums.unrealengine.com/u/DatDopeDan)\
**Post date:** [January 5, 2022, 4:48pm UTC](https://forums.unrealengine.com/t/niagara-spawn-particles-on-static-mesh-surface-based-on-mask-texture/155126/7 "2022-01-05T16:48:58Z")

</div>

I’ve been attempting to work on this as well, this tutorial does something similar to what you describe with a skeletal mesh, but the Sample Texture module is showing up blank for me in UE5.

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/d/7/6d7d695694380614d7dde891e41f5e0174ed6399.jpeg "UE4 - Niagara Texture Sample - Part 4 - Skeletal Mesh") ](https://www.youtube.com/watch?v=EXapT4GJWmA)

Any luck resolving your issue?
