Snarkpit Articles


In this tutorial you will learn how to create and implent normal maps into your custom source engine textures. Normal maps are textures that make your original texture look 3d.

If you do not know how to implent a regular texture than This tutorial is not for you!!. Instead you should probably visit this link here.

Also please note photoshop will be used for this tutorial but it is NOT necessary for the creation of normal maps. It's just the program I use. As an alternative you can use Paint Shop Pro, or other freeware solutions.

Getting What We Need


For starters we will need to download NVIDIA's Normal Map Tools. These can be found here.

After installing the NVIDIA tools open up the image you desire to create a normal for.
The image I will be using a normal map to create will be:



The Creation



Before I usually create a normal map in photoshop I usually change the image into grayscale mode, change the contrast to give the normal map a little more detail that change it back to RGB mode so you can use the Normal Map tools. But that is ofcourse optional.

Once your texture is opened go to (in photoshop) Filter - nvTools - Normal Map Filter...

Once there I usually change the settings until I get the most sharp normal map possible. Under Height Generation I usually keep it on 4, and under Alternate Conversions I usually change it from Normalize only to Colorspace.

On the below picture I used those settings but Inverted the X and Y because I wanted the rocks in my texture to stick out instead of the cracks between the rocks.



Now that we have our Normal Map we need to save it as a tga. In order for a normal map to work it should have the same name as the regular picture except with a _normal on the end. An example of this is for the rock76.tga texture I used. The normal map would be called rock76_normal.tga

Compiling


Your regular color texture and your normal must both be put through vtex.exe so they can be made into two their corresponding .vtf files.

If your were making this texture in hl2dm your textures would be in the :
youremail@whatever.comsourcesdk_contenthl2mpmaterialsrc(your folder name) folder.

After running your texture through vtex.exe it would save the textures in your:
youremail@whatever.comhalf-life 2 deathmatchhl2mpmaterials(your folder name) folder.
Remember (your folder name must be created in BOTH places.

Setting Up the .VMT


Okay so now we have our color image and our normal. For those using my rock76 texture we have the rock76.vtf, and our rock76_normal.vtf.
But every texture needs a .VMT
We are going to create one very simple .VMT called rock76.vmt.
To create a .VMT all you have to do is create a .txt file and after putting in the desired informationed renaming it into a .VMT

Open up that .txt file now and I will show you what to put in it and why.

"LightmappedGeneric"

{
"$basetexture" "tut/rock76"
"$normalmap" "tut/rock76_normal"
}

The LightmappedGeneric tells the engine that the texture is going to be lit by the map. That just basically means it will be a map texture not a model texture.
The $basetexture just tells the engine what texture the .VMT goes with.
And the $normalmap tells the engine that the texture rock76_normal is rock76's normal map.

Seeing Your Finished Result


Now you must test your texture ingame to see how it turns out:



Post ReplyView Topic
Discussion
0 starsPosted by WaggleM on Thu Aug 9th 2007 at 12:05am

Hi, I have had some problems getting the $normalmap "..." to appear in game. I made a proper color and normal map that looks great in other 3d software and even tried it out in the Doom engine. But when I put in source it appears flat, using only the color map. When I change $normalmap to $bumpmap in the .vmt it appears bumped... but I assume its converting the normal map to a grayscale image. I am using a series 7 geforce card and it seems like normal maps arent working at all for me in counterstrike, is this a known issue?

Thanks, great tutorial.

-Matt
0 starsPosted by reaper47 on Sun Aug 13th 2006 at 7:18pm

Very helpful!
0 starsPosted by Anthony on Fri Jan 13th 2006 at 5:30am

Good tutorial. I would've liked a brief explanation of some of the other options, but I guess they're best left to experimentation.

Just on PSP: I use PSP 9 and I don't think the plugin likes it. I have not managed to get it working at all. If anyone uses PSP and has got it working succesfully, PLEASE contact me. (Sorry if this is off-topic)
0 starsPosted by tovlakas on Mon Nov 28th 2005 at 12:17am

Wonderful tutorial! I always wondered what normal mapping was, and how to accomplish it. Now I know!
0 starsPosted by cchjoe on Fri Oct 28th 2005 at 1:54pm

Nice tutorial. one thing you didnt mention.....my vtex also made a text file for the normal texture, do you need that one and if so, what gets put into it?
0 starsPosted by Andrei on Wed Oct 26th 2005 at 5:42pm

I was wondering how this was achieved.
0 starsPosted by 7dk2h4md720ih on Tue Oct 25th 2005 at 12:57am

A short paragraph at the top describing exactly what you're trying to accomplish wouldn't go amiss. Otherwise, good job. Nice to see some new tutorials up. smiley
Post ReplyView Topic