Creating a custom tree brush (based on slope, terrain texture etc.)

Hello !

I couldn’t find any information online so here I am, wondering how hard it would be to add some constraints to tree painting, as mentionned in the title, like painting only if terrain texture is grass, only if it is flat etc.
I can kind of see how I would make a script that clears every tree based on texture or slope (which might be the way I’ll have to do this) based on the unity api, but is it hard to create a tool that would directly paint only where I tell it to, via script ? I’m pretty sure other people have thought about this, but I couldn’t find it (maybe I’m using the wrong words in my research, English is not my native language).

Thank you !

I could have sworn that the terrain tools package had this feature, but it looks like an oversight from the devs to not include the brush filters for painting foliage too.
Alternatively there’s this free extension Massive Foliage/Mesh Placer | Terrain | Unity Asset Store that you can modify to your needs

Yes it’s one of those weird things, and I’m kinda surprised there is so little on this problem online.
Thanks for the link, I started creating my own tool for trees and this will help do the same for details. it is quite an interesting experience as my first unity editor tool

1 Like

Hello again, I’m back because I can’t think of another method than mine, but it starts to get a bit slow when I have a lot of trees. Basically I just loop through every every tree that exists and , depending on the chosen rule (let’s say “keep only trees on that texture”) I keep them or delete them. But with tens of thousands, or hundreds of thousands of trees, it can get quite slow, is there a better way ?

https://www.youtube.com/watch?v=7WcmyxyFO7o

Allowing use of brush mask filters for painting Trees and Details is something we’ve discussed. Work on Terrain Tools so far for painting has just been height and splat modification.

1 Like

So… any progress about painting trees and details with mask filters?

3 Likes