While I have been working on my church and all of it’s props for a couple of weeks and traveled for a week, I’ve also spent some time on landscape materials. I just finished with a dynamic material that applies three material on the surface based on its slopes. With my current setup it means that grass goes on even surfaces, rock on slopes and dirt between them to make the transition look better. The material is adjustable and layered so that I can paint other materials on it.
I want to mention that I didn’t come up with this material by myself. I followed a video tutorial by RATSGAME. Even if it’s not completely my own creation, I can say that I learned new techniques and got some good experience with material functions and blending.
Below is the basic setup of the material function. All of the materials used in the final material have a similar setup. Separating the individual materials into functions makes the final materials setup a bit less chaotic. The idea of this function is to have a large and small version of the same texture and its normal map and blend those depending on players distance to the surface. Basically the surface near the player has a smaller texture to show details in the characters own scale, but when the player looks far from his own position, the texture is much larger so that he can’t see the texture tiling hundreds of times next to itself. The same blending is also done for the height maps. The height map is used to blend between different materials smoothly, so it needs to stay the same size as it’s texture.
Final Material Overview
Below is the final material. It’s a bit small image, to see everything, but I’ll try my best to explain what’s happening. On the left side is the dynamic layer which automatically sets grass, rock and dirt on the surface. Right side has the layer setup. First layer is the dynamic one and four other layers are materials that I want to be able to paint on it. At the moment they are: Sand, Gravel, Dry Grass and Moss. If I need more layers I can just copy the material functions above and assign new textures in it. Then I’ll just add a new layer in here.
Basic idea of this blending is that the dirt material is in the bottom, add rock on top of that and grass on top of those. The blue nodes in the middle are MatLayerBlend nodes. Left one receives base material (dirt), top material (rock) and an alpha channel to handle the masking. Right one receives the cliff/dirt combination and adds grass on top of them. Their relation to each other can be adjusted by controlling the height maps (green nodes in middle).
This is the mask for dirt + rock that is used for MatLayerBlend node.
Here’s a preview of the final masked dynamic material from the second MatLayerBlend node.
These are the parameters for the non-dynamic layers. I can change the large and small image sizes and the distance where small image is changed to large one.
And finally here’s the layer blending. It’s a bit messy because I’m bringing materials into a material, so I have to break them into components, feed them to a layer blend and finally plug them back in to a MakeMaterialAttributes node.
How it works in practice
Here is a GIF where I’m just changing some masking parameters, so that you can see what kind of adjustments I can do.
Here’s is how the material reacts to sculpting
I can’t upload videos, because I can’t afford to pay for the premium plan, and I can’t make so high quality GIF that I could demonstrate the distance blend, so you can just imagine how it might work 😀
I’m still working on the church, so there won’t be a post about it for a while, but I was thinking that I’ll make a post about some props that I made for it.
Thanks for reading!