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. Let’s switch our Shader Editor back to the 3D Viewport by clicking the bubble icon in the upper left of the program and choosing 3D Viewport.

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 top bar (or bottom bar — Blender’s interface is always changing) and choose Cameras, then Active Camera. You can also hit 0 on the numeric keypad.

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 the perspective that you’ve been seeing during all those test renders we’ve been doing, though without the terrain — remember, the subdivision/displacement only gets calculated during render. You can break out of this view at any time by just panning/rotating around the scene as per normal.

The 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 left clicking on it (or on the word Camera in the Outliner). Next, let’s go back to the Object Properties panel by clicking that orange square 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 → Cameras → Active Camera.

The (zoomed out) view from the camera; it’s now aimed correctly 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 Output Properties panel. You get there by clicking the tab with an icon of an photograph coming out of a printer, along the left side of the Properties panel. 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 “100%.” 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, for example, 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 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. I’m going to set mine at 50%, so that it will take me less time to do the various intermediate renders that I’ll be showing you throughout the tutorial.

Set Orthographic View

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

This might be the point at which renders start slowing down for some of you (they did for me). So, you might want to tweak those settings for samples/tile size to make things run a bit faster. And while you’re at it, you could always adjust the final render dimensions to speed things up, too! All these things are covered in the previous chapter.

In any case, things are definitely starting to look more terrain-like, though it’s still very spiky, the lighting is way off, and the camera is still not lined up — it’s not capturing everything in my test DEM. So, we’ve got some work to do still.

Right now our camera has a perspective view. 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.

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 green icon of an old movie camera on the left of the panel. Notice up on top of the panel are some Lens settings, and the lens Type is set to Perspective. 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 in the Object Data Properties panel. 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 square 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 terrain is way too exaggerated (remember how spiky it looked, when seen from the side), but at least we’ve got the camera correctly set up now. While we’re thinking about it, though, let’s go ahead and lower the terrain exaggeration. Select the plane, then go back to the Shader Editor (remember the icon in the upper right of the 3D Viewport lets you switch). Go back to your Displacement Node and lower the Scale number; I’m going to use 0.3.

Screen Shot 2021-12-05 at 2.18.29 PM

This was something we could have set in the last chapter, but without having our camera in position, it would have been hard to guess at a correct setting. Now that our camera is set up, we can try different settings until the exaggeration matches what we want. Plus, it’s been a while since we’ve been over to the Shader Editor, and it’s good to practice going back and forth and remembering what we did in the last chapter. The resulting render is much better, with fewer overblown shadows.

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