Blender Relief Tutorial: The Camera

Previous Chapter: The Plane

Now it’s time to turn our attention to the virtual camera which we will use to capture our relief image. If I browse around my studio a bit in the 3D view, I can see it’s this thing that looks sort of like a wireframe pyramid with a triangle attached to it. Right now it’s positioned to capture our plane from an oblique angle.


This weird thing is a camera.

I can confirm that this is true by positioning myself in the 3D view window to match the camera’s lens, so I can see what it sees. To do this, go to the View menu on the bottom bar and choose Camera. You can also hit 0 on the numeric keypad. Do not hit 0 on the ordinary keyboard; this will cause all of the objects in the scene to disappear. If this happens to you, go to View and choose Show All Layers.


In any case, now we can see the camera’s view of the plane, and tell that it’s pointed obliquely at where our terrain will show up. This view should match up with what you’ve been seeing during all those test renders we’ve been doing. You can break out of this view at any time by just panning/rotating around the scene as per normal.


A view from the camera.

Positioning the Camera

If we’re going to do a proper shaded relief, we need our camera to be directly overhead of the terrain; this is the perspective that the majority of maps have. Getting the camera into position is easy enough. First, let’s select it by right clicking on it (or by left clicking the word Camera in the Outliner). Next, let’s go back to the Object Properties panel by clicking that orange(ish) cube icon we used to get there last time.


Welcome back to Object Properties.

Now we can see our camera’s position and rotation in the scene. Just like we did with the plane, we can change these numbers to put things in the place we want. Let’s start with the camera’s Location. Set the X and Y values to 0, and the Z to 3 (the exact Z value doesn’t actually matter too much, so long as the camera is put a modest distance above the terrain). You should see the camera now positioned above the plane.


Unfortunately, it’s not pointing toward the plane. We need it to point straight down, and for that we need to fiddle with the Rotation. Set the X, Y, and Z rotation values to 0. Now the camera will be pointing downward at the plane. You can confirm that by going back to the camera view: View → Camera.


The (zoomed out) view from the camera; it’s now aimed at the plane, but much too small to capture the whole thing. We’ll fix that presently.

Set Aspect Ratio

There are a couple more things we need to change about our camera. Right now, if you’ve noticed, the camera’s aspect ratio doesn’t match that of our plane. The plane (if you’re using my example DEM) is taller than it is wide (“portrait format”). The camera, on the other hand, is set up to capture an image in landscape format: wider than it is tall. So, the camera is the wrong shape the capture an image of our plane. Let’s fix that.

This time we’re going to go to the Render Properties panel. You get there by clicking the icon of an old still camera on the far left of the set of properties icons. We visited here earlier, turning on the experimental features.


Once you’re there, you’ll see a bunch of properties that tell Blender what you want your final output to be. Look for the Dimensions options. Notice that there’s a place to enter the Resolution of the final image. Plug in the dimensions of the heightmap you’re working with. For the example file supplied with this tutorial, that’s 2000 for X and 2800 for Y.


If you go back to the camera view, you’ll notice that it changes as you enter the new resolution, matching the aspect ratio of whatever you entered. As you can see, it doesn’t quite line up with our plane yet, but it’s got the right shape at least.


Right below the X and Y numbers is something that says “50%.” If you mouse over it, you’ll see that it’s described as “Percentage scale for render resolution.” Blender will take your X and Y resolution values and multiply them by this much. So, if this is set at 50%, the final image you output will be 1000 × 1400 pixels. You can plug in whatever number you like here.

If you go under 100%, you’ll make a relief smaller than your DEM. This can be handy during test renders: smaller images take less time to render, so if you crank this number down temporarily, you can do some quick tests to make sure you’re happy with how things will look, before raising the percentage again for the final render. Sometimes, too, based on the relationship between your DEM resolution and your map’s final needs, you may want to take this number higher or lower than 100%. Be wary, of course, of raising the number too high: things will get pixellated as you oversample your plane.

In any case, it’s a useful input, letting you make the final image larger or smaller while keeping the aspect ratio the same, all without having to calculate new X and Y dimensions.

Set Orthographic View

Let’s do a test render and see how things are coming along.


Things are definitely starting to look more terrain-like, though the lighting is way off and the camera is still not lined up — it’s not capturing everything in my test DEM. We’ll fix that presently.

Right now our camera has a perspective view. It’s too subtle to easily tell in the above image, but as we get farther from the center of the image, the terrain curves slightly away from us. This image from Wikipedia might clarify what’s going on:


Have a look at the right side of the diagram. In a perspective view (such as you have when you take an ordinary photograph with your camera), all the light in the scene converges on the lens of the camera, so that you see parts of the sides of some object. The farther away from the center, the more of an angle to those light rays, and the more we see of the sides of mountains/valleys/etc. Again, in our sample render above, you might not be able to tell unless you look carefully, but the effect is there.

Maps generally do not have this perspective distortion. Instead, they usually have an orthographic view, in which everything is seen straight-on, top-down. You may even be familiar with the concept of orthophotos: real life aerial imagery has perspective distortions, which can be corrected by rectifying them in GIS software. It’s sort of like we’re able to position our camera directly overhead of each part of our scene at the same time.

We can tell Blender to capture orthographic images, instead of perspective ones. To do this, first make sure the camera is selected. Then, bring up the Object Data Properties panel by clicking the icon of an old movie camera on the right.


Notice up on top of the panel is a Lens setting. Select Orthographic. Problem solved!

There’s one other thing we need to tweak while we’re here. If you’re looking through the camera view, you’ll notice that it doesn’t line up with the plane (at least with my heightmap). The camera is currently going to capture an image bigger than the plane. We want it to line up exactly, so that we neither miss any of our terrain, nor photograph anything outside our terrain. We do this by setting the Orthographic Scale. Notice if you mouse over it, Blender says it’s “similar to zoom.” Changing this number lets us zoom our camera in or out.

To make the camera line up exactly with the plane, we simply need to plug in a number that is twice the largest dimension of our plane. I won’t lie: I am not 100% sure how these numbers end up being related in this way. But they are. In the case of my plane, I plugged in an X value of 2, and a Y value of 2.8. If you don’t recall, you could select the plane and re-visit the Object Properties panel by clicking on that orange cube icon again.

So, for my orthographic scale, I need to plug in 5.6 (which is 2 × 2.8). Yours will vary based on the DEM you’re using. You can even do a little math in this entry box if you want. You can type “2 * (your plane’s greatest dimension)” and Blender will do the multiplication for you.

Once you’ve got the right number plugged in, your camera should be lined up with your plane nicely if you go back to look through your camera view.


And if you do a test render, you should be able to tell that the camera is now perfectly in position.


The lighting is still not right, but we’ll fix that next. Meanwhile, to recap, we

  1. put our camera in position and made it point downward;
  2. set the dimensions of our final render, which fixed our camera’s aspect ratio; and
  3. set our camera to an orthographic lens, with a scale that matches our plane.

With that, we’re done with the camera. The last major piece of the puzzle remains.

Next Chapter: The Sun