Wasabi Defense background, part 3
In this article, I will explain how I created the hills. For this I used POV-Ray and Moray; basic knowledge of these tools is assumed for this tutorial. The key element in this tutorial is the so-called heightfield. This element takes a bitmap image and turns it into a 3D object using the brightness of the pixels. White pixels forms mountaintops, black pixels form valleys. The trickiest part is generating the image for the heightmap. This is done with The Gimp. First, create a new image and apply the clouds filter (Filters->Render->Clouds->Solid Noise), wich will generate a random cloud-like pattern. You should set the size to the same aspect ratio as the image you’re using. For example, I used a 1680×420 image, so I set the size to 8×2. Next, the detail. The more detail you add, the more peaks and edges your hills will have. Low detail results in smooth hills, while high detail yields detailed mountain peaks. Here’s the cloud pattern I used:

Using this as a height field will give you a uniform field of hills, but that’s not what I needed. I needed two hills with smooth slopes, that appear to rise out of the ground. For that, I created a new layer, filled it with black and added two white elliptic shapes with feathered edges. The mode of this layer was set to multiply. Now the pattern looked like this (first with the second layer in normal mode, then in multiply mode).


This will already yield two hills, but the transition from the hill to the valley between them is too sudden. This should also be a smooth slope. For this, I added another layer with a gradient. It’s a double gradient that goes from white to black and then to white again. The mode was, again, set to multiply. Here’s what the layer and the final image look like:


Okay, that’s it for the map. Next, it’s time to fire up Moray and create a heightfield. I gave it the same width and depth ratio as the map. I then loaded the heightfield file and rendered it, using a widescreen camera and omnidirectional lightsource. The material you apply to the hills isn’t important since we will adjust the colors later it The Gimp. One final thing for the heightfield: I checked “smooth” and set the water level to 0.15; everything below that will be cut off. Here’s the result of the rendering (click for full size). For the sake of clarity, I rendered it with a black background for this tutorial, but for further processing I rendered it with a transparent background.
Next, I opened the image in The Gimp and copied and pasted it as a new layer in my background image. At this point they still looked gray, but with the colorize tool (Tools->Color Tools->Colorize) I changed it to brown. I also tweaked brightness and contrast a bit, resulting in this image:
Almost finished! The only thing left is some sort of shadow at the bottom of the hills, to make them blend better into the rest of the image. I created another layer, turned the alpha channel of the hills layer into a selection (right click in layer dialog box, “Alpha to selection”) and filled it with a gradient that goes from white at the top to black at the bottom. The transparency of this layer was set to 50% and the mode to multiply, yielding this final result:
And voila, a pair of cool looking hills! I added another one in the center, lower and darker to make it appear far behind the other hills, but I used the exact same method for that. By varying the settings for the could filter in the initial map image, you can get different types of hills. That’s it for this tutorial, in the next and last one I’ll explain how I created the bright star and the planet.




Leave a Reply