Building Worlds with Landmass | Unreal Engine

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

A question to folks who have a better knowledge of Landmass and landscapes in general.

It's very WYSIWYG which is cool but does that have an impact in terms of performance (I mean in comparison to doing terrain effects offline with tools in development).

My understanding is the default landscape tools (with painting) is an offline thing, there is not much in the way of runtime performance considerations.

However with Landmass Arran mentions in the video that performance is something to consider (especially when having multiple components on a terrain). At the same time he mentions that you can export the hieghtmaps out for further processing at development time (which implies the output is static as far as a packaged project goes).

👍︎︎ 3 👤︎︎ u/boarnoah 📅︎︎ Jan 07 2021 🗫︎ replies
Captions
ARRAN LANGMEAD: Hey, everyone. My name's Arran Langmead-- technical artist and the UK evangelist for Epic Games. Today I'll be taking you through the Landmass Blueprint plugin in Unreal Engine. Landmass is a new way of procedurally and non-destructively modifying the landscape. This feature along with the Landscape Layers has made editing large maps significantly easier. Before, any changes made to the landscape were permanent. But now it's a simple case of clicking and dragging to literally move mountains. In this talk, I'll be showing you the various use cases and benefits of this tool, how these Landmass Blueprints work, and how you can go about building your own tools. Keep in mind that these tools are experimental so are subject to change and may not be as user friendly to edit compared to other tools in the engine. For this demo, every model has been made in the engine using either Landmass, Procedural Mesh Blueprints, or the new modeling tools. Let's start with a very quick overview of the Landmass tools and how they all work. So I've got this little environment here that I've been working on. It's this nice, little, small island. It's got a few different Landmass Blueprint brushes that I've used to build it. And it's going to serve as our little kind of playground while we're messing around with these tools. So for those of you who haven't used it before, we have got some videos on setting up with Landmass. But I will very quickly just go over how you enable it. Inside Plugins, you just enable the Landmass plugin. That will give you an extra Landmass Content folder, which you can find in your Content Browser. You may need to enable Show Engine Content and Show Plugin Content in order to see it. But you don't actually need to worry about these files when you're building. So if I go to our Landscape tab-- you can do that with Shift, too, by the way, if you're interested-- and go to my sculpt layer, you'll see we have a button here called Blueprint. Now, in order for this to work, you do need to have Landscape Layers enabled. So make sure that you've got that turned on. You can do that when you first build a landscape or just by clicking on it and going Enable Edit Layers. With our Blueprint layers enabled, you can see that we have a load of layers here. And then, inside these layers, I have these extra Blueprint brushes. So these are my brushes that I'm using to modify and to build this particular landscape. The first one we're going to look at is the Material Only Landmass Blueprint. I've got one here, which is doing some quite subtle, simple deformation. But I'm going to add a new one just so we can kind of mess around with it and tweak it without worrying. I'm going to create a new layer first and just rename that. And under Blueprint Brush, I'm going to navigate down-- choose Landmass_MaterialSimple. Now, I've got a few extra properties here. You may only have CustomBrush_MaterialOnly. That's absolutely fine to use. They both do pretty much the same thing. They just use a different Material that's a bit simpler. And once we've selected which one we want to actually add to our scene, all we need to do is click. And then this will add this particular landmass to our scene. Now, what is this thing actually doing? So you can see, we've got some weird kind of warping and modification happening to our landscape at the moment. Well, what this does is take a Material, feeds in some data along with the current landscape, and then modifies that landscape in some way. So in this instance, we are generating some noise using this Material, which is going to be fed through this particular text here. We're combining it with our current heightmap, and we're outputting it. So for this particular Blueprint, I can select a Material, which in this case is going to be how I want to modify my landscape. And then I can set parameters. So for this particular Material, I have a noise texture. So I can feed in whatever noise texture I want. And then I have some parameters that modify that particular noise texture. So I'm going to go ahead and add in a sand heightmap. Then I'm going to adjust my gradient scale. And you can see that, as I'm scaling this down, you can see that this kind of tiling becomes a bit more prominent. And I can kind of move this around as I need. And I can kind of increase or decrease the elevation scale. So you can kind of see that, as I'm moving this up and down, I'm kind of adjusting it. And what's really nice is that, again, all of this stuff-- all of these changes that I'm making are non-destructive. So if I'm not happy with this at any point, I can delete it. I can just turn it on and off as I need if I'm not sure I want to keep it or not. And that means that, as an artist, I can go through and I can try different things out and I can modify and change without having to worry about doing any major deformation. It also means that I can stay inside the editor for longer. So I'm not having to kind of switch back and forth between other applications to build my landscape. I can build it directly in the editor. So for this particular effect, I can kind of decrease it. I also have an Invert option, which is going to change those kind of lumps and bumps that I have to indents, which is going to be much more reminiscent of sand buildup. And that's the basics of a Material Only Brush. Now, let's have a quick review. So there's a Material Only Landmass Blueprint Brush that you can use, and it affects the entire landscape. It's handled almost entirely in Material. So all the Blueprint's really doing is setting up the initial parameters and passing that data through to the Material. The Material's then doing all of kind of the grunt work in processing and building a new landscape. And then it outputs that landscape. Now, the Material itself can use either textures or some custom expressions built with HLSL or a mixture of the two, just like you do with any other Material. And then that is output back to the landscape, which it then is applied to. Now let's take a look at the Custom Brush Landmass Blueprint. You'll find this one right at the top. Again, you should have access to it. It's part of the Landmass plugin. All we need to do, again, is choose that brush and then click anywhere within our world. And what this does is use this spline to generate a shape, which you can then modify and adjust and change however you want. And this shape can then be blended in to your current landscape or overridden, however you kind of want it to handle that. Now, unlike the Material Only Blueprint, this only impacts a certain area. Although it does require a redraw of the entire landscape, it uses a mask to control the falloff of this particular effect. What's quite nice about this is that I can go in and I can edit it and I can adjust the shapes and I can kind of move this wherever I want. And I also get a load of extra options that control the shape of this particular object. So if I were to press Cap Shape, that will let me limit the top half of this current object. I can also adjust the angle that I'm kind of doing so I can have a really sharp falloff on this particular one if I want to, or I can have it be quite wide and quite soft. If I go down to Effects, I have a lot of different options for things like Curl Noise, which allows me to kind of modulate and warp the original shape. I can also use Smooth Blending to control-- to give me a soft and hard top and bottom falloff. So I can kind of adjust this one here, and that will kind of smooth out this top part. And if I go underneath, you can see I can kind of smooth out this base pass as well. So it kind of has a nice softer blend. So to sum up, the spine-based Landmass tool modifies a specific part of the landscape rather than the entire landscape. It uses an in-world spline to dictate shape, though you can technically use anything you wanted to for that shape generation. And do keep in mind that it will still redraw the entire landscape even though you're only affecting a small part of it. The last thing to keep in mind is that these tools are generally more complex to build because you have to deal with more texture generation in order to get them to work. So next up, I want to show you how quickly we can start prototyping landscapes and environments and, as importantly, change those landscapes and update them and the benefits of doing so. So let's start off with a brand-new landscape. And what I'm going to start with here is a Material overlay. So this is an effect that is going to affect the-- so this is a Material that will affect the entire landscape. So I'm just going to drag it on. And let's select a new noise texture. Increase my elevation strength. And we can control the strength of this. And then I'm just going to set that to invert. Let's add-- let's duplicate this. And I'm just going to adjust the position, the scale, and the intensity. And then let's just-- as we're being artists, let's do three. So there's some base sand detail. And now let's go in and add a sand dune. This is controlled by a spline. So I can just go in here and add that. We can control the falloff tangent. So we can make this really sharp if we want to. And we can also smooth it out. I'm happy with that. I'm just going to reduce down the strength and then duplicate. Just reduce down the number of points we're working with. And I'm just going to have this kind of intersect here. That's looking good. Let's just up the size of that and duplicate another one out. And I want to have this one kind of curve out. my resolution's looking a little bit low on this one because it's getting a bit long. So I'm just going to increase my resolution on my surface just to give me a slightly rounder shape. And let's add another point in and just round out this one. OK, so we've created a basic kind of desert shape here. But I want to show you how quickly we can edit and modify the landscape into something completely different and use the exact same tools to build this new landscape. So let's see how quickly we can turn this desert into the surface of the moon. I'm going to drop on a new Material. That is going to my moon surface. And these dunes aren't really working for me anymore. So let's just turn those up for now. My Material surface is looking OK, but let's swap it up with something that's a little bit more moon-like. So instead of this sand, I'm going to get a moon heightmap. And we're just going to adjust the scale of this. Let's swap out one of the others, as well. We'll start seeing some craters forming on our surface. That's looking a bit better. That first Material's looking a little strong. I'm just going to tone that down a bit. I want to add some larger craters to this. So I'm going to use my sand dune effect that I built and just raise that up. So these are exactly the same. They're just in a ring formation. So our atmosphere is looking a little bit thick for the surface of the moon. Let's just go in and edit that. Get rid of my Exponential Height Fog. Click on my atmosphere. Let's take out some of this color and move it a little bit further away. A couple of thousand miles should do. Now, here's one of my favorite things about editing with Landmass. If I press Play and I'm using my Advanced Locomotion System Character, which I got off the marketplace, I can see that I can't get up this sand dune. Normally this would be a real pain to go in and fix. But because I'm using Landmass, I can simply click on the crater that's the problem and increase my angle. And then I can replay and see if that's now working. So let's run over to that crater. And now I can see that my character has no problem getting up to it at all. So on to a more advanced topic, let's actually dive into how these Blueprints are made and how you can go about building your own. We'll start off with the Material Only Blueprint because that is the simplest iteration. And what I have here is a very brief overview of how these tools work. So at the start, we have our landscape height texture, which we bring in using the Blueprint. And we have some Material parameters that we use to modify our Material. Then we pass that information through a Material, which modifies the landscape in some way. We render that Material to a texture, which becomes our new heightmap. And we output that new heightmap to the landscape. Let's see that in action. So here I have the Material Simple Blueprint and the Material that we're going to be using with that Blueprint. As you saw from the diagram, all we're really doing with this Blueprint is setting up a custom Material, inputting some data, and then drawing this Material to a texture. This all happens inside the render function. We can grab our current heightmap data from this In Combined Result, and then we can output to the landscape using this return value. Before we do any of this, though, we do need to do a quick initialization step. And all this involves is setting up our manager data. All I'm doing here is checking to see if our Brush Manager is valid or not. Is it assigned to a particular asset? And if it's not, then we check to see if one already exists in the world and set it if true. And if it doesn't, then we just make one. And that's all we need to worry about with this. It's an important step that we need to make sure that we've got in all of our Blueprint brushes. So just keep that in mind. Back to our render function, we do two main steps-- we set up our Material, and then we draw that Material. Inside our brush setup, we are creating a dynamic Material instance, which is set here. And then we set variables for that Material instance using these parameters here. I have a texture set here, which gets our current landscape heightmap and sets that to a texture. Same with a noise texture, as well, which I'm going to use to modify our landscape. And then, finally, we have a vector parameter, which controls location. And we have some scalar parameters set, which will allow me to tweak and change those Materials. Once we've done that, we have basically made a Material that has been parameterized and customized in some way. All we need to do, then, is draw that Material to the render target. And that's done in this Draw Brush function here. I clear my render target of any previous texture data that may be in it using Clear Render Target 2D. And then I draw my new Material to that render target. Let's take a quick look at the actual Material itself so that you can see what's going on. This Material can be broken up into two key sets. So we have our original landscape data right here, and then we have our new landscape information that we want to combine over here. The combination itself is just an add. And then the modification itself is going to be based around this texture. These parameters here are going to let me set my location and scale of my texture. These parameters here are going to allow me to actually set which texture I want to use and allow me to invert that texture if I want to using this scalar parameter here. Then I control the strength of that noise texture. So how much deformation is that actually going to do to my landscape? And then that gets added back in. Now, most of this is probably looking quite standard, something that you've probably used before when you've done any Material editing. What might be a bit alien to you is the unpacking and repacking of the texture data. Now, this is done because our heightmap is actually being stored in the R and G channels rather than as a full 16-bit texture. So in order to work with this heightmap texture, we first need to unpack using the RG8 height function. And then we can modify however we want. Then we clamp back to our 16-bit range and then repack that data back into the red and green channel texture that we were using before. And that's all there is to the Material Only Landmass Blueprint. Now, let's take a look at the slightly more complex version where we're generating some mask data. Like with the Material Only Blueprint, we're still doing the same setup. We have Material parameters, and we're inputting some texture data that is getting processed by a Material, which in turn is then rendered to a texture and then returned to the landscape. However, on top of this, we're also generating some new land data on top of that. And for this, we're going to need to make a distance field texture. For the example that we're going to be going through, we're going to use a spline, which is going to create a sand dune effect. So in our example, we're using a spline to define a rough shape. This is then used to generate a mask in a texture. That mask is then fed through a jump flood component, which extrapolates out from that shape to give us an angle that we can use. And then, finally, that jump flood and mask is used to generate a distance field texture, which we can use to blend this new shape into our Landmass. Now, if all of that sounds horrendously complicated, you are correct. But do not worry. All of those complicated elements have actually been built for you already inside the Landmass plugin. So all we need to worry about is generating our mask data. And then we can use the premade jump flood component and use the premade distance field generation to create those textures for us. So back to our island, we can see the effect that we're going to be building here. So I have this spline component. And as I move it around, you can see that it forms the landscape for me to create kind of a nice kind of ridge effect that I can use on my environment. Now, if I go to our Brush Manager, we can actually see this thing in action. So if you'll remember, we were talking about this mask generation. This is exactly what we're generating here. So inside our Brush Manager, we have a render texture called Depth and Shape RTA. And if I were to keep this open and then give this spline a bit of a wiggle, you can see how this is rendering to this particular component. So if we go back to our Brush Manager, you can see, inside here, we've got our mask generation. And we also have our jump flood generation, as well. So you can kind of see that line being formed around there. And then, if we want to see what our distance field looks like, we can go back onto our asset here, scroll down to Distance Field, and you can see what the distance field shape is also generating. So again, we can see that kind of baseline that's been created here, and we can see this kind of radial staggered gradient coming out from there. And again, all of this stuff is editable in Engine. So as we're creating and moving this around, you can kind of see-- you can see how the distance field is being edited and changed. And this is the texture that we're going to be plugging into our Material that's used to edit our landscape. So let's open up this Blueprint and see how it works. So again, inside my event graph, I have that initialization, which sets the manager. Then, inside my render component, I have four key functions. I set up my brush. I draw my spline shape. I create my distance field. And then I draw that Material to be used for the landscape. So you can think of this as a few set stages. We have our initial setup, which gets our parameters, whether these are textures or floats or vectors. We generate some shape and height data, which will be combined with our landscape. And then, finally, we combine that data together and return it. So the brush setup is very similar to the Material. In fact, we only really have one additional parameter, which is setting up a new dynamic Material and also a render target for our distance field. Unlike with our Material modifier, we need to generate some extra texture data, as well. So we draw a spline to the texture. Here I'm using-- I'm retrieving my Depth and Shape RTA, which is held inside the Brush Manager, and looping around a set number of times to draw a series of lines to create my spline. Once I have that, I generate my jump flood using the jump flood component found inside the Brush Manager. And then once I've built these textures, I simply need to generate my distance field from those. So the distance field and jump flood may look quite complicated to build, but these are actually pre-built components inside the Brush Manager and the Landmass tool. So all you need to do when you're building your own is reference them and use them. Once we've generated our new data, we use a Material, which is this custom one here, to generate our new heightmap. Let's take a quick look at that Material. Now, again, this is just a very simplified version of the Material that you can find in the Landmass tool. All we're doing here is generating our new data, combining it with our old landscape, and outputting that. So we've retrieved our landscape using this. So let's just call this Old Landscape. We add it as just a simple way of adding our new data. We read our distance field shape, which is the distance field generated from the jump flood and from the outlying component. And then we add some parameters that allow us to control that. So I have an angle parameter here and a soften falloff parameter here, which allows me to control the steepness of the sand dune and how softly it blends into the current landscape. So to wrap up, let's just go over some last tips to help you get started building your own tools. The first one is just to make sure that you keep your work backed up as you're working either by using version control or some other resource. Remember that you can also export your heightmaps and weight maps out at any time. This is really useful not just for backing up but also for editing those textures and reimporting them back in using external tools like World Machine or ZBrush. When you're using your Landscape Blueprints, I also recommend keeping them on separate layers. And when you're building the tools themselves, I highly recommend doing it in a test map rather than the main map that you're actually building in. You may run into some performance issues when you're working on any landscape over 4K. And if you do create any landscape over 4K, you'll actually have to use an 8K texture in order to process them. Reducing the number of components will improve performance. So keep that in mind. If you can drop those down, then do so. And if you want an extra challenge and you've got heightmaps working, then I would move on to weight maps. So we didn't get to cover it in today's session, but this tool is used not just for heightmaps but also painting weight map data as well. So if you want an extra challenge, give that a go. Finally, these tools are experimental, just another quick reminder. So that does mean that they are subject to change. They may work differently between different builds. And you should take care when using them. Right, and that's everything. Thanks for sticking with me through all of that. I hope you found it useful. If these Landmass tools seem interesting I highly recommend enabling the plugin and trying them out. We're always keen to hear about what people think and also to see what they've made. So be sure to post up on the forums and share it with us on social media. You can find me on Twitter @arranlangmead if you want to ask any questions.
Info
Channel: Unreal Engine
Views: 138,126
Rating: undefined out of 5
Keywords: Unreal Engine, Epic Games, UE4, Unreal, Game Engine, Game Dev, Game Development
Id: GwJiN8LLnQI
Channel Id: undefined
Length: 28min 15sec (1695 seconds)
Published: Wed Jan 06 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.