Unreal Engine 5.4 - PCG and Landscape Materials Interactions

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello guys and welcome back in this video going to keep our journey talking about PCG and in this video going to work with blend landscape blend materials in PCG to create masks throughout our level those Concepts together can be really helpful in the environment creation to achieve better results and as always if you like the channel content don't forget to subscribe and like the videos also if you want to learn more about materials I just released a course about materials inside the F real engine just check it out in the description so let's get started uh we are here in the exact same file that we created in the first video about PCG that I made in the last week and in that video create a forest system and that you can control the density of the forest the scale and the rotation of each tree and each component so you have a few rocks as well also this system is interacting with the water system uh which means that uh whenever we create anything with the water system a lake uh other lakes or sea or anything like that uh the the trees won't be inside of the water so we can can do that so if I go here and I change the size of the the lake as you can see the forest uh adapts to to the shape of the the lake so that's what we did in the last video and in this video we're going to create another uh material uh to our landscape that this material be a path so we're going to create a path uh throughout our forest and the idea is that uh we're going to paint our path and it this path is going to delete all the trees to don't have any trees in our path at the same time that we can SPO other things in our path like different shapes of rocks maybe some kind of weeds or stuff like that so that's the objective of the video so let's get started uh to start we need to create really quick a new material so we're going to go in the first floor which is our material that we create the grass in the last video and I'm going to create another set of texures to create our material to be our pathway I need to do uh a small refactor over here so here I need to change from forest floor I need to use material attributes so here and here I need to search for the materials that I download from Kel Bridge so here I have the this Rocky Forest here and have the the textures here uh by the way guys if you feel lost about what I'm doing here I have other videos that explain that in more details and so yeah so here have the set mature attributes need to create this node set mature attributes over here and these set material attributes I need to create uh the base color roughness and the normal so here be our base color our normal and you can use the the alpha channel of the base colors to be our roughness it's exactly the same thing as you use the the Rd map I'm going to do that just because it's a little bit faster here need to delete and I need to change the the sample sorcerer no not the simp the M value mode to derivative in both of the textures so I get that that I'm doing this just to break the the UV uh just because to just to be harder to export any tining repetition since is a landscape usually is a really big texture so it's easy to be spot any repetition so I'm doing I'm breaking the UV to avoid that so here and then I need to use another set matal attributes I almost there guys okay and then I need to use a blend a landscape layer blend so the landscape layer blend it's a node to create um different layers of uh landscape materials so here we can create rocks grass uh mud sand wherever you like and you're going to create layers different layers inside of our landscape and doing that you can uh paint different uh textures and materials in our landscape so with that's we want to achieve so here to do that I need to create a few layers so the first layer will be the grass nice so in the other one will be our [Music] back I'm going to plug both over here and then I'm going to go and plug in the first floor and then I'm going to hit apply probably it might take a while to compile everything and go here that was quick so I'm going to change from selection mode to landscape mode and as you can see uh if you go here and paint now we have two layers the two layers that we create here in our material and now if I go here and select the path going to have a brush and if I use my path as you can see you can Bain a paath so yeah now let's let's solve uh now let's show you the the problem that we created doing that because now if I open our PCG graph uh we start this PCG graph in the last video so if you want to know how those things work uh in this the the previous video going to I'm going to show you the more details and now uh I'm going to show you uh what's the problem that we create doing the path so if I go here in the surface sampler and I increase the density just a little bit uh as you can see that you have trees in our path and and it'll be a cool thing just like because we're doing PCG if you anytime that we P paint any path uh automatically the the trees disappear and you can SPO other kind of meshes in the path and you're going to Sol this problem right now so here you have our our graph it's pretty simple right now but if you haven't seen anything like that it would be a little bit overwhelming but basically you are going to delete this connection delete this connection and I'm going to go here spawn points so basically here you are spawn spawning all the points and as you can see uh because you're interacting with the the water system there is no spawning points in the water this spawning Point each each of these points will be a tree or a or a rock or anything that I want that I create in our estatic mesh spawner and what we need to do here is take out all these spawn points where from where you have the path and to do that uh it's simple we need to go here in the surface sampler and then let's search for filter attribute filter how does this not work so I'm going to go here inside of our filter so the target the target attribute you can call I'm going to call the grass uh how can how can you understand grass uh because here you have the G landscape data right so here you are you are gathering all the data from the landscape and the landscape has these two layers and one of these layers is called grass so if I go here and the attribute filter and the target attribute will be grass uh this attribute you understand that you are getting this data over here in the layer so that's why it's working and here we need to change the the threshold uh attribute for density and now what I'm telling to the the PCG so well you have this surface sampler you know the surf sampler okay so I have filter so I want in this filter I'm filter everything that has the grass material and inside of this filter this filter you be the difference instead of directly the surface sampler if I do that as you can see there is no spawning points in the paint in the the path anymore and if I create other path in a force region as you can see there is no any spawn points in the in the path anymore and with with that we solve the problem of the trees in our path as you can see there is no trees anymore in our path and anything any any time that we paint the path we just need to go here in force region and then you have our path without any trees and the other thing that we can do that would be really cool it's uh we can use this output over here which is outside of the filter so this is another output that saying okay so inside of the filter you want be the difference and use this as a difference and spoil the trees but outside of the filter will be our path because is we have just two material so far so if it's not a grass it be a path so I'm going to go here and I can create another surface sampler uh and the surface sampler needs data from the the landscape otherwise won't work so we're going to go here and now as you can see you have points so now you're spawning all the points but just in the path that's exactly what we want and here I'm going to use the other node that's often used in PCG which is the transform points to control a little bit the control a little bit the the transform of these points so if I go here and change so now we have some random rotation which is good and also we need can pick the scale mean Max two then we have maybe a bit too big but uh let's PHA a few things to see how it works and H the transformation point I need to use another node called aesthetic mesh spawn is exactly the same that we spawn the trees so static Mash spawner here and here you need to can go in the match entries and add a few entries so in the first one will be in the description let's search I download a few rocks and new elements so I'm going to go here what am doing yeah here entries now we have description [Music] Rock have these maybe let's add another one that could be a weat that cotum Cotton Tree cotton grass search for like a smaller one maybe let's try out this one now let's see if you have something maybe it's too small yeah definitely it's too small actually where I missing the scale over here so yeah I'm going to I'm going to increase I'm going to increase the scale of the things a little bit just because this path is really wide we just lost a little bit the the scale so if I go here and scale going to it's like 10 maybe you Max 15 something maybe that's too big but then yeah maybe this way sounds good so now you can see that we have a few cotton plants and some rocks in our path and you can put everything that you want in your path or even nothing if you want and in this way you have our path that you can create you have our forest and you have our water system so that's it for this video guys thank you for watching watching and probably going to create more PCG content in the future and stay tuned see you soon bye-bye
Info
Channel: Unrealverse Labs
Views: 2,409
Rating: undefined out of 5
Keywords:
Id: N_O-_2i_jNA
Channel Id: undefined
Length: 15min 12sec (912 seconds)
Published: Wed Apr 03 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.