Thursday, 19 April 2012

Terrain Tutorial

People have asked me a lot for pieces of terrain, or my terrain "rig", which I don't really understand because there's nothing to it, it's just cubes. The reason they're smooth is because I just beveled out the edges, but I wouldn't recommend doing that if you're starting out because the UV mapping starts to get tricky and it can take up a lot of memory. Here's a quick tutorial on how I set up my terrain though. You should familiarize yourself with blender first, I'll mention some of the basic shortcuts and controls in the tutorial but don't rely on it. Keep in mind this tutorial was written with Blender 2.62.


So first add a plane and scale it up by 10 (press s, then type 10 or hold ctrl and scale it up until the number at the bottom reaches 10). Subdivide it, go into the toolbar (T) and set the number of cuts to 19. Should look like this:


The reason for that is because now each square is half the size of the default cube.



You don't have to do this, but it keeps things consistent and if you add my minecraft rig into the scene it'll be automatically set to scale. Now before you start extruding enable the snap during transform button at the bottom of the 3D view, so that everything automatically snaps to a grid and maintains alignment.


Also press ctrl+tab and enable face select mode. Now press C and select a bunch of faces, make whatever shape you want.


Press E to extrude, and drag your mouse so that everything goes up 1 square.


Keep selecting faces and extruding them to form whatever terrain you want. Right click to select individual faces and press x>delete face to delete them.


Now we have to texture it. Go into the material options and create 2 materials. Call one grass top and one grass side. Select everything (a), select grass side in the material options and hit assign. All the faces are now assigned to that material, but we want all the top faces to be assigned to the grass top material. So first make sure you have the "limit selection to visible" button enabled so that you don't select through faces.


Go to the top view (7 on numpad) and switch to isometric view (5 on numpad). Now press b, and drag the selection around everything so that it selects all the top vertices.


Now select grass top in the material options and hit assign. If you want you can re-colour grass top to green and grass side to brown and see if it worked, and also if you missed anything. So now we have to assign the  actual textures to the materials, go into the sidebar (N) and enable textured solid under display so you can see the textures in the 3D view.


Select grass side in the material options, and hit the select button. Now open up the image editor, click image and Open Image. Select your texture, you can use the terrain file with all of the textures in it from the minecraft.jar file if you want, but you have to change the uv coordinates to isolate the exact texture that you want, so I'd recommend separating them out into their own 16x16 files. Here's the basic 5 if you need them: http://dl.dropbox.com/u/53122678/Tutorials/terrain/minecraft_textures.zip
So once you've textured the grass side faces, do the same for grass top. Select grass top in the material options, hit the select button, open grass top in the image editor.


If you render it you won't see the textures though, because they're not actually assigned yet. Go into the textures panel with either grass side or grass top selected in the material options, and hit new. Change the type to Image or Movie, and under Image hit Open and select the corresponding texture. Then under Image Sampling disable MIP Map, Interpolation, and change the filter from EWA to Box. Under Mapping change the Coordinates from Generated to UV, and select the one UV map (or leave it blank, doesn't matter if you only have one).


So there you go, if you render it you'll see the textures. I'm not going to explain in detail how to make the edges smooth, but what I did basically is set the bevel weights for all the edges that I wanted to be smoothed out to 1, added two bevel modifiers and set the mode to weight, and then applied them. It messes up the uv coordinates so I unwrap the entire mesh using cube projection, and then align it the best I can in the uv editor. All the assigned textures get messed up too, so you have to redo that as well. It's not a very pleasant process but I did it anyways because I really liked the result.

45 comments:

  1. Very very very nice tutorial. :)
    And congratulation on your new blog.

    ReplyDelete
  2. It's great trying to make my own animation

    ReplyDelete
  3. Cool what do you use for lighting

    ReplyDelete
  4. Im having trouble with the plane it does not look like that. And the ctrl c thing either I'm using version 2.63

    ReplyDelete
    Replies
    1. What do you mean? Follow the first few steps and it'll look like that. And it doesn't say ctrl C, it's just C.

      Delete
  5. Hey,

    I followed everything, but, under the UV Map drop down, there's nothing to select, and it's making the textures diagonal I think. Any ideas?

    Thanks,
    Izaak

    ReplyDelete
    Replies
    1. You have to go Image>Open Image first, and then it'll be stored in the dropdown.

      Delete
    2. Thanks for that, it worked a charm. :)

      Delete
    3. It is still diagonal. I folowed everything but it is still diagonal.

      Delete
  6. hey man could you do more tutorials like this please, i would like to know how you do your rendering steps to make it all smooth and good , i would like to know how u get the flush looking background behind ur scenes , i would like to know how u bevel the edges of the blocks , i would like to know how u pick up and drop objects, thanks , sorry its a bit much im almost confident enough to make my own animations :)

    thanks

    ReplyDelete
  7. i'm very confused about this one "go into the toolbar (T) and set the number of cuts to 19."

    ReplyDelete
    Replies
    1. please help!

      Delete
    2. Press T to open the toolbar, a little window that pops at the side in the 3d window, and at the bottom there will be the number of cuts for the subdivision. Increase that value.

      Delete
    3. how do i get to its subdivision on blender 2.63

      Delete
    4. Push W while in edit mode with the entire mesh selected. Then select subdivide in the menu that appears.

      Delete
  8. id would be great if you would explain in detail how to mooth the edges. Its very hard for a beginner to figure out how to do it from that 3 sentences!

    ReplyDelete
    Replies
    1. Don't worry about it. If you can't figure it out focus on more important things like the animation/story and whatnot.

      Delete
  9. didn´t work for me. when i do the step with the image editor the textures dont appear!

    ReplyDelete
    Replies
    1. You have to have textured solid on in the sidebar, or be in textured mode.

      Delete
  10. THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU!!!!!!!!!!!!!!!!!!!!!!!!!!

    ReplyDelete
  11. whenever i render after doing everything you just said everything just showed up green. 0.o

    ReplyDelete
  12. Could I ask? How to eneable face mode and why I can't see the tezxture when rendered? Thanks for the tuts!

    ReplyDelete
  13. Hey VMComix, why don't you use Mineways to import your Minecraft world into Blender? It would save the process!

    ReplyDelete
    Replies
    1. Well, Mineways makes stuff a bit too small, like using his rig, Steve would by like 10-15 blocks tall...

      Delete
    2. Yes, but you can scale rigs, so honestly the rig would work just fine with Mineways.

      Delete
  14. hey uhh, can you please explain the bevel wieghts a little better. i did exactly was you siad and it didnt word

    ReplyDelete
  15. i followed all the steps completely and when i put the grass texture in, it doesn't look like normal. I used the textures in the link but its just brown a green, not all pixelated like on vm's.
    FYI im using blender 2.63

    ReplyDelete
  16. I only seem to be able to texture one part of the grass ither Top or side but once i do one i cant do the other?

    ReplyDelete
  17. plz help i dont get it

    ReplyDelete
  18. When I texture the grass on top, I can't do the side and its the same if I do it the other way round. Help please. I'm using blender 2.69 by the way.

    ReplyDelete
    Replies
    1. I'm having the same problem. How did you fix it?

      Delete
  19. i have no idea how to add a plane

    ReplyDelete
  20. your face features are glitched update them for blender 2.69!

    ReplyDelete
    Replies
    1. Yes, please teach us how to fix

      Delete
    2. Glitched in what way? They work fine for me.

      Delete
  21. When I try to do the top texture it just shows green! help.

    ReplyDelete
  22. whenever I texture it, it makes the all of the squares show the single image and not one image in the separate squares. please help me!!

    ReplyDelete
    Replies
    1. I fixed it but now they show up as 2 diagonal pictures in one cube...-_-


      Delete
    2. Make sure your faces aren't triangulated and reset the uv's. Scale down the uv coordinates to whatever square you want, easier if you separate the squares into their own images though.

      Delete
  23. in your environment video, there was a background with the mountains. how did you do that? teach us pls

    ReplyDelete
    Replies
    1. That was just a curved plane with a render of a mountain mapped on as an image. I modelled and rendered it in a separate file.

      Delete
    2. apart from being low-poly, are there any other advantages for this comparted to actually making the background?

      Delete
    3. Sorry I didn't reply. It was just more convenient for me to not place an actual model for the tiny portion of background, you can do it whatever way you want. It was also easier to move it around and do test renders.

      Delete