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).
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.
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)
You should end up with something like this:
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.
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.
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)
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:
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:
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!