*Another tip:* You can also make a layer that erases this procedural foliage. This can be done by creating an alpha landscape layer (let's call it RemoveGrass), taking its sample and substracting it from the other layer samples that place the grass meshes. If we paint this RemoveGrass layer onto our grass landscape layer, it will remove the grass at this location. Super useful!
Taking the same approach, you can sample a texture for player buildings or roads, wild fires, terrain manipulation, etc. If you can "paint" the texture at runtime, you can use it to remove or add grass at will. A minimum node right before the output will make this much simpler, unless you want to filter out tough shrub grasses or for some reason need a layer to ignore it, but then that layer can be lerped in afterwards.
The only note I'd like to add on this approach is that without UE5 and decent runtime virtual texture support, you'll have to consider linking the texture to the player's location on a timer, and focusing the rendering around them. I wouldn't even link it directly to the player, rather snap and update every second or several and have it then affect only the local landscape and grass layers. With RVTs, you can honestly be pretty excessive in terms of texture size so this isn't as much of a concern.
Thank you for your instructions! I've seen a lot of comments about the grass not showing up on the landscape, I had it as well. When creating a landscape in unreal 5 you get a group of LandscapeStreamingProxy children. You need to set you material to every child
Yeah, it looks like you can also select the "Landscape" actor, clear the "Landscape Material," and then re-select it (drag the material back in) again. That should work too.
I may be suggesting this prematurely, but a tip I learned from an evangelist: Redundant layers for LOD density and distance scaling. I use 5 layers PER grass type, more in some regions. I clump an absolute truckload of extremely dense grasses around the player, and span really wide but sparse models out into the horizon, and the layers allow me to have the appearance of lush grass as far as the eye can see while in reality, 90% of it is within 20 meters of the player and it's just mixed to "overlap" scaling with reduced density as it gets further away. This also allows me to have grass shadowing, as I enable it per layer, (aka, only on the closest and densest layer which fades out completely between 15 and 20 meter range.) and of course, use a simplified material for the further away grass... But the blending isn't an issue, since some of the lower LOD grass is mixed in close to the player: It's just always shorter in height than the highest LOD grass so it's hard to tell it isn't shadowing (you honestly can't tell at runtime, but in screenshots you notice it.)
Everytime I make progress in UE5 immediatly after RU-vid suggests another video which shows me how to do what I just learned a better way by a different content creator. I had no idea there was a landscape grass actor which allowed me to control its attributes directly. I was wondering how I would do something like this last night as I went to sleep. On the flip side I have started creating a collection of different grass mesh in Blender which I can use for my landscapes. Thank you for the video.
Not natively - it also can't have Custom Data and other variables, or even be assigned a Material Instance at runtime. It's a bit limiting and it might be better to look in to PCG if you need more control over the spawned meshes.
This is fantastic. Thanks for the tutorial man! Just a quick question, how good is the performance hit on a large scale map using this process? Because as you said it's procedural and doesn't have to store any location. So I'm hoping it's actually quite a good setup. I'm just getting into Unreal again for the first time in about six years or so haha (having been using Unity for the good part of that six years)
So helpful! If you want foliage to react to the player (such as grass or bushes that get pushed a bit when you walk by them) do those need to be placed via the foliage tool or can they be placed via landscape layer?
It depends on the method of interaction - if you're using shaders/render targets (I have a 3-part series about exactly this) then it can be placed procedurally with Landscape or the Foliage tool :)
Just going to post this comment to share something that made me lose abouuut 5 hours of my time yesterday, in the hopes it might help someone else who's (somehow) going through the same issues as me : • I followed this video to make foliage on my landscape, BUT I first wanted to create my own foliage models on 3DsMax. Made grass, poppies, ferns, and imported them as static meshes in UE5, The 'Landscape Grass Type' thing didn't made a pip when I fed it static meshes, so I assumed I did it well. BUT I hadn't realized that it actually wanted 'Foliage actors' instead of 'Static Meshes'. Just a simple formality which made the whole thing crumble. • ALSO, there is a glitch in UE5 where the landscape material often goes 'nope' and disappears on you, leaving your landscape with that grey checkered texture instead of the dirt/grass/sand. Combine that with the foliage not working, I was losing my marbles. The fix was to change the 'Sampler Source' value of every 'Texture Sample' in the Landscape Material to 'Shared: Wrap'. And yeah, it did fix things for me. Hope that helps anyone! Good luck!
Hey there :) My friend Marpetak Dev has a great tutorial on how to model some grass in blender, otherwise you can use my grass model here :) www.dropbox.com/s/zf6cuzrjz9hhsyk/PrismaticaGrassLongUpwardNormals.fbx?dl=0
Is there anyway to have procedural foliage on just static mesh? Unreals landscape system is a crashing nightmare... especially in a streamed environment in 5.3.2
Hi, thank you for the guide! I have dne everything, but I have one issue. When I paint or sculpt someting and pree ctrl Z to undo, grass landscape grass data breaks, some meshes of grass flies in the air. I even downloaded another grass mesh to double check that, but it still doesn't work. What can I do?
Hey Dominic De Co Co (italian fingers) This is a bug that's been around forever - I don't think there is a solution currently other than reloading the map. It can be a real pain in the ass but I'm afraid there isn't a good solution at the moment :(
Do you happen to have a video explaining how to colour the mesh you use for the grass and make it wiggle in the wind? I am stuck on figuring this out for a long time and it would greatly help me.
@@PrismaticaDev Wow you are quick mate. I've figured it out. One thing I now encounter as an issue is that to make a nice grass plain, I have to set density to about 800 and that makes the UE5 FPS go to about 40. Would making the grass model larger in Blender on the x and y, so I have to load in less seperate meshes work, or do you have any recommendations on fixing this another way?
@@EddyZorn most likely you need to specify some culling distances - it might be rendering grass everywhere when you don't need to, especially far away from the camera. It would also be worth checking your Early Z-pass settings in the project settings and make sure they include masked materials
Hi, I'm getting a lot of black on my grass, always showing up on one side, do you know how to fix this? I've disabled dynamic shadows, removed AO, turned on Cubemap Ambient light, recreated the lightmap and reimported a new grass model... still the same black everywhere.
Hey Halleck!! Check the grass in the World Normal view mode - the back faces may be pointing straight down if you're using custom upwards normals. I actually have a video about fixing that exact issue :)
Try plugging in a “1” value to the grass output to see if that works. If it doesn’t, double check that you’ve assigned the right GrassType to the node in the landscape material, and if it’s still not working just double check that the GrassType itself is set up correctly and the culling distance is high enough
@@PrismaticaDev thanks for getting back to me. Maybe because I am using UE5, but the Grass static mesh is not displaying in the mesh selection for me. is this one you have created yourself or a preset of UE4. cheers
@@jackwareing1840 Any luck on this? I'm having the same problem and I tried entering a solid value of 1 and it's not working and I know this grass works because it's being used by another Landscape Material
I'm trying to work out how to set this up with my Auto material but My grass layer has a dirt layer blended into it to help with texture repetition and I'm not sure if its possible to stop the grass from spawning on the dirt as its technically a grass material.
Hey Kyle! If you’re blending the dirt using a Lerp with some noise going in to the Alpha slot, simply take the same noise and subtract or multiply it before the landscapegrasstype node, depending on if the dirt is A or B
@@PrismaticaDevHi. I'm using a Material Function for my Grass/dirt blend, In the material function I'm using a blend material attributes node to blend two textures with the dirt's Make material attributes node in (B) and the grass one in (a). The texture sample with the noise is connected to a multiply, power. Then the power is clamped and the clamp is in the Alpha of the Blend material attributes node which is connected to the Output result node. The only Lerps I'm using are the ones that are connected to my distance blend and multiple texture samples before the Make material attributes nodes of both textures. Was it a mistake blending two textures together in a Material Function? Would it be better to blend the separate grass and dirt Material functions together in the Auto landscape material?
Hello,someone know how to change the Instance Material Parameter of a Grass from a Landscape Grass Type? i need to change the color of my grass during the day and night. thanks!
Hey ! How can i do, if i want add a maximum angle for my "landscape grass type" ? i know there is a function in the foliage tool, but in the landscape grass type i don't find an option (even in the material) :/
Great question! You’ll need to do it inside the landscape material by using VertexNormalWS node and creating a mask based on the Z axis (B channel) Check out my video about vertexnormalWS and you should be able to put something together :)
Is there a way to control the layer edges? Meaning, I want a super sharp transition between grass and road (e.g. no grass meshes on my road). I've tried the inclusion/exclusion layer option but I still see grass meshes on my road.
I have a question about this grass if I have a building system in my project and I want to build some thing at place where is growing that grass, how can I delete grass under this building at runtime? Thanks)
Hey there! You could try using a Runtime Virtual Texture to push the grass underground/make it invisible. Check out my Grass Occlusion video for some ideas :)
I'm digging into trying to get thick animal fur on a material, but not having much luck. Is it possible to get foliage "grass" to show on a skeletal mesh?
That would be something you'd need to go manually in blender - there are a few great plugins for adding hair cards to meshes. You could also try using a "shell" fur method
I dont understand why my grass is so much more spaced out, I made my own grass model in blender and it seems properly sized, yet the spacing on each one is huge and I cant get dense fields of grass.
Hello! I was directed here from the creator of the Blazing Highlands pack to setup automatic grass on my painted landscape. I'm following along with your tutorial, but nothing is working. I'm editing their M_LANDSCAPE_MATER material (which looks slightly similar to yours) however, when I attempt to temporarily connect the Landscape Layer Sample to the Base Color and save, it goes black. I see that you then detach it (is it supposed to just be free floating in the material graph editor?) If I plug their existing Landscape Layer Blend back to base color, my painted landscape reappears. *WHEW* I'm using UE5.2 btw. Has anything changed/updated since you last post this video? Really need to get this to work for a client gig, any help would be greatly appreciated. Thx!
The Landscape layer sample is just a black/white mask of where the layer has been painted. You'll want to put that in to the landscape Grass output, not base colour output. The base colour output it for Colour haha
@@PrismaticaDev Yes, i get that. I was following your example to see the mask, however, my entire landscape turned black. Once I hook it back into the Landscape Grass Output, the originally painted landscape returns. It is all grass with a path road painted in. I can’t seem to get it to work. Again, I’m working from an already existing master landscape material that I’m trying not to corrupt. I’ll attempt to make a screen recording tomorrow afternoon and post for you to review. Thx.
I did this some time ago, and it worked very nice, im trying it again and nothing happends, the grass or the rocks never appears on the landscape and I have no idea why
Tried to fix it for 4 hours or something like that. The issue was that the landscape was on X axis on 100, and it was not producing anything. Changed to 1 and produced results. Changing it again to any other value keeps the grass types but it deforms the meshes to that corresponding value.
mate can you give link to download the Static Mesh for the Grass , rocks , Bush and Trees (the ones that you are using in this video) ... I cant find good stylized landscape and foliage assets . Thanks in advance both for assets and the tutorial .
Hello! I'm not able to share the assets since they're originally from the marketplace, although I've edited the textures and colours to suit my project
@@PrismaticaDev oh its fine man , thanks again . One more thing I might have messed up something , I did everything as you showed in the next video (auto landscape one) for some reason my surface texture (green as in grass) is black completely and its not doing the auto landscape either when I sculpt .
I tried using this on an auto material (auto cliffs material) and the grass is spawning on the cliff faces? How do I get this to not spawn in the cliff face? I have my cliff face set to a completely different texture sample from what the Landscape sample is pointing to
@@PrismaticaDev I have the same problem as them, but I don't have any slope masks. I used the auto material from your "Landscape Auto-Cliffs" video. I need help, because this is really getting on my nerves.