From the course: Maya: Natural Environments

Applying a 2D height map with Texture Deformer - Maya Tutorial

From the course: Maya: Natural Environments

Start my 1-month free trial

Applying a 2D height map with Texture Deformer

- [Instructor] One very cool way of creating a terrain is with a height map and a Maya texture deformer. A height map is a bitmap image on disc in which the brightness of a pixel represents elevation or height above a ground plane. And that height map can come from various sources. You can use an external program such as View or World Machine to generate a height map. You can paint a height map directly in an image editor such as Photoshop or you can apply GIS or geographic information system data. And that's what we'll do in this example, I have some GIS data which was downloaded from the US Geologic Service and it's an area of Oregon and Southern Washington that includes Mount Hood. The area that I want to map here is quite large. It's actually about 50 kilometers on a side. And in order to accommodate that in Maya I need it to adjust the scale of my layout. It's no longer a one, one hundredth scale as we've seen in previous movies. This scene is actually at one, one thousandth scale. If I select this plane primitive and go into its channel box input nodes and the polyplane node I've got a width and height of 5,000 centimeters. And if this is a one, one thousandth scale model that corresponds to 50 kilometers on a side. And I've got subdivisions width and height set to 200. The beauty of the height map technique is that we can change the subdivisions and change the level of detail later If we need to. With that plane object selected let's add the texture deformer in the modeling menu set. Go to the deform menu and choose texture. And the texture deformer node is selected automatically and we see its parameters in the channel box but we're not able to assign a texture from the channel box. We want to be in the attribute editor for that. So we can watch the attribute editor ctrl + A. Now, if you de-select or select nothing or select anything else you'll lose this texture deformer panel there. So just to illustrate, if I click off my object I don't have that texture deformer visible anymore in the attribute editor. We can just re-select the object and then go up to the tabs in the attribute editor. And we can select that texture deformer once again we see point space and direction up here. Point space is defaulted to UV. In other words, we're using the UV coordinates of the object in order to place this height map onto the object. And the direction is set to handle. Handle refers to a handle or a locator in the scene which allows us to manipulate the height map, change its location on the surface, change its orientation and so on. That's a separate object and if we open up the outliner, we'll see there is a texture deformer handle. I'm just going to leave that where it is it's right at the origin and I don't need to change its position or orientation. So I'll just leave that alone. Back in the texture deformer attributes, go to the texture slot, click on create render node. Create a file node, in the file note attributes. We want to change the filter type to off. Just as we saw with a matte painting we don't want to pre-filter the texture. So leave the data alone. And we'll browse for the image, click on the browse button. In the current projects source images folder, I've got a PNG file labeled height map Wy'east 3601 by 3601 gray 16 bit. Wy'east is the native American name for Mount hood. This is the resolution of the file, 3601 square. And it's a gray scale image with 16 bits of dynamic range. I do recommend that you use 16 or 32 bit images as height maps. If it's an eight bit image then it'll only have 256 levels of elevation and that's going to be kind of poor resolution. So we want a 16 or 32 bit image. Click open, and that is applied but it's not going to look like very much. Our plane object is very, very large and the default texture strength is very low. So we'll need to increase that. We can go back to the texture deformer attributes by selecting the plane and then select that texture deformer tab in the attribute editor and increase the strength. Let's bring that up to a value of 3000. It's going to need to be very high because the size of the plane is very large. That's strength attribute is an absolute value. And if we change the scale of our object by changing its dimensions then we'll probably need to change the strength to match. All right, so let's, deselect that object and see what we've got. We can tumble around with all the left mouse button. So here's the Columbia river and here's Mount hood. We can zoom in on that, dolly in with alt and right mouse button. Take a look at that. And it looks pretty low res. It's pretty low detail, but we can increase that level of detail very easily. Select the object. We can go back to the channel box back to the polyplane node drag our mouse across the subdivisions with them height and increase that up. Now the height map file as we saw is 3601 pixels square. And I would like to use that value here to capture the maximum detail. But unfortunately the polyplane will not allow me to plug in a value that high. It tops out at about 2000 by 2000 subdivisions. So I'm just going to take 3601 and divide that in half. And that'll give me roughly 1800, so I can plug a value of 1800 for both the width and the height press enter. And I get a warning saying you have very large subdivision values. Do you really want this? I'll click yes. And it will take a moment to calculate that. Once it does, we'll see a much greater resolution. So click off the object. And now we've got pretty decent resolution to our height map here, and we can orbit or tumble around and take a look from different angles. We select the plane object, go back to the polyplane and maybe we can reduce this a bit we'll bring it down to half. Let's make it 900 subdivisions in each dimension and click through. Now, we've got a lower level of detail to our height map, but that's going to take up less memory. And eventually we may need to delete the construction history on this plane. And if we have a lower level of detail, when we do that plane we'll take up less memory and less space on disk. That's the basic workflow for applying a height map to create a terrain with a texture deformer.

Contents