How to make a normal map using Gimp

From Custom Map Makers Wiki
Revision as of 09:30, 4 December 2011 by John (talk | contribs)
Jump to: navigation, search

If you don't have the Gimp normal map plugin, download it here: code.google.com/p/gimp-normalmap

We'll start with this seamless texture: Seamless texture

The lowest resolution will do fine.

If you don't have a cgtextures account, create one now.

First things first, scale it down to 512x512 pixels so it is a power of two and doesn't mess around with some texture settings. Save it, that will be the base texture we need.

Next we will create the normalmap. You'll find a simple filter under Filters - Map - Normal map. First thing you want to change is the filter, 4 sample just doesn't do bumps. 3x3 doesn't do much either. (The higher the numbers, the less bumps you get, so don't even bother with 5x5 etc) Sobel gives weird results, I never use it. Prewitt 3x3 is the way to go. Check the "wrap" box on the right, this will give you a seamless normal map. You can ignore most of the other options, just hit okay and wait for the map to be rendered. You'll end up with some mostly blue image. If you want you can go test it ingame right now, but I can tell that it won't give you much bumps

To get some more bumps, press Ctrl Z to revert the image, then hit Ctrl Shift F to reopen the normal map generator. Set the scale to -5. Scale defines the depth of the bumps. It must be negative because otherwise the mortar would stick out of the bricks which looks weird. Generally the brighter parts will be nearer to the screen than the darker ones. You can also invert the colors instead of using a negative scale, but it really doesn't matter. Hit okay and wait for the map to be rendered again.

You can see there's a lot more red and green in the normal map. Way too much actually. The bumps for the mortar are decent though. If you look at this ingame, you will see tons of distortions on the brick and it will look like shit.

One could paint over the bricks with the default normal map blue, but that's a serious amount of work and since we are lazy we don't want to do that.

So hit Ctrl Z again and go to Filters - Blur - Selective Gaussian Blur. This tool is goddamn awesome. It blurs parts of the image based on contrast. Max. delta defines the contrast threshold needed to blur something, the higher the more will get blurred. 50 is fine for this texture, though you may want to lower it if the texture has low contrast. A blur radius of 30 is usually fine too. If you got a slow CPU and don't want to wait too long, try 20 or 15, but it shouldn't be less. What you can see now is that only the bricks are blurred.

Now reapply the normal map filter. You'll notice there are a lot less distortions, though there are still a few ones we don't like.

Hit Ctrl Z once again and then switch to the contrast tool. Increase the contrast by 80 and decrease the brightness by 80, too.

Then fire up the selective gaussian blur again, set Max. Delta to 65 and reapply it. The image is now very washed out and looks really bad. We don't care! Reapply the normal map filter and you'll get very little distortions. If you want even less distortions, try the 3x3 filter instead of Prewitt 3x3. You may want to increase the scale then though. (Or decrease if it's negative )

White parts on some of the bricks will create huge distortions, just paint over them with the blue color.

If you take a look at this ingame now you'll notice some serious bumps. If they aren't enough you can still increase the scale, but keep in mind this will create more distortions and will require you to put more work in the normal map.

Hope this helps some people, just discovered the Selective Gaussian Blur tool not an hour ago myself

PS: Final result here: hazewood.de/img/cg_bricks_n.png This has distortions though. I was lazy