Blender Tips and Tricks #3 - Height maps and bump maps!

Hey again guys!

I decided to do another tutorial, this time on displacement maps and bump maps going more in depth on their potential applications. I’ll be working in Blender 2.81a, but this tutorial is compatible with previous and future versions as well (most of what we’re doing is going to be in your preferred photo editing software anyway).

The things you’ll learn here are good for realistic scenes where characters are close to the camera or are in focus, as you want them to have the most detail possible. I’ll try and go as in depth as possible for those that are newer to graphics, even if I’ve explained these concepts before, so I’m sorry if I get a bit repetitive.

To give you guys a sneak peak of what we’ll be making:


Turntable by @Doc_021, shirt and pants by @lkarus

And if you stick around long enough, we’ll do this one as well (its much quicker I promise):


Turntable by @Doc_021, shirt and pants sourced from this group (I won’t say made by them because I dont know who made the original)

Let’s dive in!


vile armor.obj (470.8 KB)
Above is the texture and obj file (respectively) of the armor I used.

Arrange the following node setup.
Orange are image textures, blue is a color ramp, green are principled shaders and a mix shader.


Remember to shift the color ramp so that the white bound is very close to the black one on the left. This is important for later.


A height map, otherwise known as a displacement map, is an image that determines how displacement occurs on an object. The white determines when the mesh should be displaced the most, and the black determines when the mesh should be displaced the least (i.e. not displaced at all). Values in between (i.e. grey) mean for different levels of displacement, all of which are less than white but more than black.

Note that the effect of white and black can be reversed (i.e. so that black is the tallest and white is the lowest) depending on your displacement strength.

With all of that information, try and draw out (in your preferred editing software, I’m using paint .net just for this) a displacement map on the uniform you’ve got. To do this, you need to visualise where on the mesh you want the armour to be extruded, or displaced, from the mesh, and where you don’t. For example, with the uniform I’m using, obviously we don’t want the skin to be displaced, but we want the armour to be popping out to look separate from the skin.

Click the link below to see what I mean.

In order to apply it, you need to increase the amount of geometry in your character. Add a subsurface modifier to the torso and each limb with a strength level of about 5 or 6 in the viewport (see below).

image

Each subdivision adds new vertices and edges to your mesh, which is good for displacement because it requires there to be geometry in order for that geometry to be raised. For example, if you subdivide a cube 5 times, it will receive 2^5 times more faces than before. Keep this in mind when you’re subdividing with your subsurface modifier, as if you get too high, your PC / laptop will start to lag out.

Now add a displacement modifier. This is what will actually alter the geometry of your mesh using the map that you feed it. Put the map you made into the texture, change the texture coordinate to UV so that the map wraps around the mesh depending on the character’s UV, change the strength to 0.1 or so and lower the midlevel.
image

One last thing to do: Select one of the limbs and go into edit mode, as shown below. Click mesh > clean up > merge by distance. This used to be named “Remove Doubles” in 2.79, and what it does is that it removes duplicate vertices (it determines whether a vertex is a duplicate by checking if it is in the same position as another).


You should get the following message (the number of vertices removed may vary)
image

You should end up with something like this:


This is the HDRI I’m using by the way

Now, remember that skin map I was talking about back in step 1? If you’ve drawn your displacement map correctly, you can just plug the displacement map into the image texture feeding into the factor input of the mix shader. By putting the color ramp bounds close together (specifically, having the black all the way to the left and white really damn close), the mix shader will treat it as if all the grey is much, much closer to white.


Bump maps are similar to height maps in that they use black and white values, but in a different way. While height maps use those values to determine how far parts of a mesh should be raised, bump maps use them to determine how far parts of a mesh should appear to be raised. It’s used to add surface imperfections like grooves, without actually altering the geometry of whatever mesh you’re using.

Image source

Each have different applications, but they overlap. For example, while we have to use a displacement map to give the armour form and shape, we can use bump maps to give it detail on the surface, which wont cause nearly as much lag as a displacement map.

Now, there’s a short and a long way to do this. The short way is much easier and less time consuming (go figure), but very scuffed in 90% of situations. The long way is more tedious (though it gets quicker with time once you get used to it) but allows you to have much more smooth bump on your models. This is the difference in appearance.


The short way

Create a bump node and connect the bump output to the normal input of the principled shader with an image texture feeding into the height input of the bump node (see below).Load in the texture of the armour into the image texture. You should get the following result.

If you’re satisfied, congrats, you’re done in terms of bump. This method is best for characters not in focus or far enough away from the camera that it doesn’t matter that the bump is so low quality and pixelated.

Why is it so low quality?
The reason why its so low resolution is because the texture on Roblox characters is pretty small, and even smaller on each limb. For example, the front face of the torso is 128x128 pixels, and the front face of each arm and leg is 64x128. This means that the front of a roblox character has about a 256x256 sized texture, which as you can imagine is tiny. As a result, you can literally see the pixels of a bump map you apply that is based on the original texture. If you want to fix this, take a peek at the long way.

The long way

To do this, open up your photo editing software, make a new canvas and load up the armour texture.
Here’s the important bit: Resize it so that it’s at least four times as large (i.e. from 1024 x 512 to AT LEAST 2048 x 1024. The reason you want to do this is because it allows for the texture on the character to be much higher quality. With a hard brush, draw over the grooves and lining wherever you want the bumps to be.

Click on the link below for a sped up version of what I mean.

Remember that the more detail you put into the bump map, the more detail you see on the character. In the video above, I spent about 10 minutes making the less detailed bump map below, but if you take another 10-20 minutes to add more detail, you’ll end up with the second one.

In addition, you can add a roughness map to add even more realism, to give the effect of scratched / rusting metal, as shown in the third picture. A roughness map, like the other maps I’ve talked about, use black and white values, but instead of changing geometry or making geometry look as if its changed, roughness maps change the way light reflects off a surface (white = most reflective, black = least reflective depending on how you’ve set your nodes up).

To add a roughness map, find one online (or just use this one), put it into an image texture node and feed it into the roughness input of your node. If you want, put a ColorRamp node in between and adjust the bounds to change the contrast of the roughness. The closer they are together, the more contrast there is.

image

With a roughness map and bump map, this is what it ends up looking like.


Now this entire process might seem a bit convoluted, but believe me, its much easier when the armour / shirt+pants you’re using is simple. Lets try it again with this model and texture for example:
gorl.obj (91.2 KB)

1.Import it

Simple enough.

2.Draw out a height map

Remember to think about which parts of the clothes you want to be taller than the others. I came up with the map below, at 2048x1024.

With the following settings:
image

3.Draw out / edit a bump map

I drew some detail where the jeans and laces are, but for the frills, you can get away with just copying and pasting it from the original texture (remember that you have to resize the bump map to at least 2048x1024 to capture a good amount of detail)


With these settings, this is what you end up with:
image

As you can see, its much quicker for simpler clothes, which is what you’ll have most of the time.


Thanks for managing to get this far, I hope this helped you!

90 Likes

Thanks! This is awesome. Just curious, for the displacement map what was the image resolution?

No problem!
2048x1024 was the resolution.

2 Likes

holy dang ripper you underrated legend

3 Likes

This is a pretty solid tutorial. More or less have experimented with the same method before. This method is pretty easily expanded upon too.

One suggestion though, subdivide the character the traditional way atleast once before adding the subd to get slightly sharper edges (looks better imo)

5 Likes

Great tutorial! Thanks man I’ve actually been wondering how to make decent bump.

1 Like

Very helpful. Thank you for spending your time on this. Really appreciated! :hearts:

1 Like

How come the character looks all “puffy” and swollen at the edges? Is there any way to mitigate this?

1 Like

Yes, as @FedoraGFX commented, you should subdivide once or twice before using the subsurf if you want sharper edges.

Note that if you subdivide x times before adding a subsurf modifier, you should make the subsurf strength whatever you were going to put before, minus x, so that you have the same kind of geometry and your computer doesn’t lag too much.

E.g. in the video below, the left is just a subsurf modifier with 5 cuts, but the right is where I subdivide 2 times and then add a subsurf modifier with 3 cuts (I wanted to remove doubles and turn off auto smooth as well but I couldn’t get it under the gif duration limit).

6 Likes

Great tutorial. Easy to follow!

1 Like

This is so creative. I love this

1 Like

Very good tutorial and easy to follow good job!

1 Like

Lovely method. I actually use Materialize to generate different maps. It’s very unrecommended but can give easy and quick maps without doing too much work to make characters look a bit more appealing.

1 Like

This is a really great tutorial, I’m sure this will help many GFX artists improve their renders, especially me!

2 Likes

This is a Helpful topic, Thank You So Much for making it.

Edit: You can delete the skin tone and leave armor not selected in your selected editing platform.

Very useful tutorial, good stuff man.