Saturday 30 November 2013

Notes on Terrain Sculpting in Unity

So a couple of weeks ago I watched the Terrain Sculpting video tutorial from Unity, which you can view here:

http://unity3d.com/learn/tutorials/modules/beginner/live-training-archive/terrain-sculpting

But one of the questions I had was: what if you want to sculpt valleys, etc., using a height map?

To be able to sculpt valleys and troughs within Unity you have to Flatten your terrain. It sounds odd, I know, but in the tutorial you set a height greater than 0 and hit Flatten. This raises your terrain to the height you specified and allows you to cut into your terrain.

To Flatten your terrain, select it, then click on the "Paint Height" button in the Inspector. You will see the Flatten button in the Brush Settings (highlighted in red below) and you can either use the slider or type right into the box. Once you have your desired height set, then click "Flatten".


If you click the "Raise/Lower Height" button you can hold the Shift key while painting and you will cut into your Terrain.

But what if you want to use a Height Map? Well you can. Flatten your image and then click on the Settings button (illustrated below).


 Then click "Import Raw" under Height Map.

 
Choose your file and your height map will be applied. I created my Height Map in Photoshop and it looks like this:

 
 
The gray colour is: R: 176, G: 176, B: 176.

The black is: R:36, G: 36, B: 36
The texture was created in 8-bit grayscale and was saved in .RAW format.
My Terrain was 2000 x 2000 pixels, so that's how big I made the canvas.

When applied to the terrain, it looks like this:



No comments:

Post a Comment