# Painting foliage on SMs based on a texture mask

**URL:** <https://forums.unrealengine.com/t/painting-foliage-on-sms-based-on-a-texture-mask/456365>\
**Category:** Rendering\
**Tags:** foliage-type, unreal-engine, question\
**Created:** [October 3, 2019, 12:18pm UTC](https://forums.unrealengine.com/t/painting-foliage-on-sms-based-on-a-texture-mask/456365 "2019-10-03T12:18:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chyslns](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@chyslns](https://forums.unrealengine.com/u/chyslns)\
**Post date:** [October 3, 2019, 12:18pm UTC](https://forums.unrealengine.com/t/painting-foliage-on-sms-based-on-a-texture-mask/456365/1 "2019-10-03T12:18:37Z")

</div>

Is it possible to use the foliage paint tool to spawn grass only on specific areas on a static mesh based on a mask?

I’m trying to achieve this effect.

 ![289049-grassingrooves.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/2/3/c233bcfa9b7dac8a8e9dd84740f7a2637d4e7bbd.png)

I’d like to be be able to restrict the foliage painting to spawn grass meshes only in the gaps between the stones in the texture.

I’ve done a workaround before in which I had a separate static mesh on top of the ground mesh. That second mesh was cut following the pattern of the texture and then I removed the stones to only keep the grooves. I painted on that secondary mesh and set it to not visible in game. This workflow was fine because it was a small diorama, but now I have to do it on an entire level and doing custom secondary meshes for all my ground pieces is not practical anymore.

I watched the procedural foliage volume video where Ryan Brucks show the procedural spawning using masks but that seems to work only with landscape layers and I can’t apply those to a static mesh. I was wondering if there was a similar way in which this can be done for static meshes.

Thanks in advance for any help!
