Is there a way to have grass be output on a landscape material but have it “masked” by the physical material? IE I’m painting with layers but only want grass to show up on the grass texture, but it’s showing up on my sand/dirt/rock textures as well.
I guess you’ve made your landscape grass output and select what foliage you want to spawn?
On your level material set up something like this I
Just duplicate your current blend node and put a constant 1 in the level you want… In the grass node select your landscape output. Sorted.
I love you.
Haha no worries. You can add extra nodes to the grass output node and make more landscape grass outputs so you spawn different foliage on different layers… Set up like this
So ny test I have grass layer with layer with foliage, dirt with none and I have farms on mine with different layout
That’s amazing! Makes foliage placement much quicker and more precise! Thank you for sharing this info
Great technique for controlling which layers affect the grass. That is way cleaner than what I was doing in kite demo by subtracting all other layers from the desired one. And since its all getting baked, cost doesn’t matter!
Thanks Ryan It’s alot easier, I couldn’t figure out how to separate the layers for ages until I realised you can add additional landscape outputs and can get some really nice effects and it only takes a minute to set up! only issue I have come across is the culling distance… Like in my screenshot on the farmland the foliage cuts off quite close and you just see dirt in the distance… Other than that it helps alot
Try typing ‘foliage.MinimumScreenSize 0.00001’ in the console. The default setting for screen size culling seems to be causing confusion for a lot of people.
How do you filter the grass placement like this when using material functions + matLayerBlends?
Thanks alot mate works like a charm now the rest of the map doesn’t look hideous
Question… If my base layer is dynamic and I want to just grass the base layer’s grass and none of the other paintable material. How would I do this?
Hi, I have a problem with generating foliage onto the layer that is not 100% painted. My goal is to have trees generated a little further out of the forest ground layer without to have it painted manually as seen on example1.
My idea was to blend from grass layer to forest layer over 5-10 meters and use Minimum Layer Weight set to 0,1 to generate trees as soon as possible onto blending zone and using **Scottc91 ** method to delay generating forest ground (example2). It seems to me that Minimum Layer Weight parameter is not working. No matter what the value is trees always generate only where forest ground layer is 100% painted.
Those settings are only for Procedural Foliage spawners, not the Landscape Grass system. The grass system is is defined using Grass Types and the material itself.
Hi Ryan, I am talking about Procedural Foliage spawners. I can’t get them to spawn foliage (trees, bushes) on a specific layer if that layer has less than 100% weight painted on the landscape. So if I have an area with blended 50% grass layer, and 50% forest layer and I want to generate trees on forest layer I will get 0 trees generated no matter what Minimum Layer Weight I set. As I understand, trees should spawn on forest layer if Min layer weight is set less than 0.5
Scottc, I cant understand why you make constans=1 and with 0, what’s the use of them??
Years later I have a similar problem. I’ve set up the landscape grass type, made the blend so that the grass layer is set to 1 and the rest to 0, but I’ve still got grass on road/dirt that have > 0% of grass layer in it. Its funny that I’ve got grass on a dirt patch only to find out that it isn’t 100% dirt but something a bit lower since you can’t see an ounce of grass layer on it. Is it possible to make the grass only appear on grass layer if say grass is painted 80% or more? It would help me with performance, as foliage painted grass needs to cast dynamic shadows to look properly, as it doesn’t receive static lighting from cliff mesh, while landscape grass can pull that up from landscape lightmap saving me some nice fps.
Use a SmoothStep function on the output of the blend layer with the range being 0.8 to 0.85. This will make it output 0 at 0.8, and 1 at 0.85.
You could also do it by something like “saturate((output - 0.8) * 20)” which may or may not be cheaper per pixel.
Thank you bruva, now I can have properly lit grass with less performance impact Although I need to paint some other layer below rocks, houses and stuff to remove sticking grass, guess I’ll get the source code and see if I can implement a collision check for grass spawning.