User Tools

Site Tools


arma:texturing:normal_maps

This is an old revision of the document!


Normal Maps

Panda[PL]: The problem with specular map is: it needs two channels to work! The texture is 2D, so one channel supplies only information on how the light is applied along one axis.

My advise on normal maps:
1) draw a height map (lighter th color the higher the point), you can use the normal texture here if you're really in a hurry, but I advise making it by hand.
2) use programs like Xnormal to convert it to normal map.
The correct channel settings seem to be:
+x -Y +Z
That's what I find easy and it has one basic advantage: all the software you use is freeware.

Another way would be making a hipoly version and using the program to make the normal map by comparing them. But for that you'll need a “pro” program to make hipoly version.

This is an alright explanation even if the final product looks like crap:
http://www.quake3bits.com/htm/tutorials/creating_bumpmaps_from_images.htm

Here's more information and how to convert from a bump map:
http://www.bencloward.com/tutorials_normal_maps4.shtml

Tutorial for normal mapping:
http://www.bencloward.com/resources_tutorials.shtml

http://www.3dxtra.cygad.net/list/561/1.htm

http://www.coronach.org/tutorial1.html

http://forums.cgsociety.org/showthread.php?f=39&t=479896

D@nte:
http://www.bencloward.com/tutorials_normal_maps1.shtml

http://www.bencloward.com/tutorials_normal_maps10.shtml

http://www.poopinmymouth.com/tutorial/normal_workflow.htm

and a tut which shows how to create a bump map with photoshop (you need the nvidia plugin to convert the bump map to normal map)

http://forums.cgsociety.org/showthread.php?f=46&t=373024

Normal Maps Tutorials

Normal Maps Tutorial by Skaven

Normal Maps Tutorial by Skaven

Ok, than we start with custom models since applying normal maps to BIS's models takes a long time to do and it's extremely boring because of the hex editing, I just did it once for trying and to be honest I didn't find it that useful if you make good textures, BIS normal mapping will still be working although not as well as custom normal maps.

Ok here we go, good luck! You will need it my English is bad.

I do my normal maps in photoshop but you may do it inside your 3d software, however I'm not a modeler so I will use only the Photoshop tutorial here and to be honest so far and in my opinion the quality seems to be exactly the same.

First thing to do as I told you is to download my RACS addon and to check how I did the config.cpp (Weapons config.cpp), it's really easy you just have to open two classes as you can see from my file and add the correct name for your mapping class/material as well as the correct names for the texture files, being the first ones the

Normal textures:
*.paa

Then the Nvidia Normal Map textures
*_nohq.paa

And last the file that gives the amount of color to the normal map, optimised Specular Map for better bitdepth
_smdi.paa

What I wrote above covers everything you need to start on the cpp file and it's pretty easy to do, just be careful while writing the config a small mistake on a coma will be enough to won't make it work and you'll take a long time to understand where you made a mistake.

Now the textures themselves.

The first thing you will need to do is to download the Nvidia PlugIn and install it inside photoshop than open all the texture files you want to normal map inside photoshop.

Once in Photoshop you have the filters above, inside of it you will have a new one called Nvidia… press it and you will see a new window, inside of which all I do is to change the percentage of normal mapping. Personally I use values between 3 and 10 but you will have to try this one for each weapon (maybe texture) since it does have a lot to do with the type of colors the textures have as well as to how detailed the models are.

It's really try and error here but I would use a value like 5 for my first try. Press enter or apply and you will see your old texture with the normal mapped filter applied now you save it as *._nohq.paa (just like you did inside the config.cpp file) and you place where you described.

Personally I use a new folder for my normal maps but this is actually a matter of organization you may not feel the need for it.

Once you applied and saved the normal mapped textures (Nvidia Plugin) you want to make the pink textures (the ones I don't recall the name in English).

So to achieve that you will take one of mine and you will copy the pink color from one of my them since that's exactly the pink you will need.

Once you did this, now you will again, open the textures as you did at first (or you may just go to history and go a step backwards so you have your textures like they where initially withouth the Nvidia PlugIn).

With this done you will now open a new layer for each texture and paint the layer with the pink you got from my addon (paint the entire layer) once you did this for all the textures you will now give it instead of the usual 100% opacity/transparency you will give it something between 85% and 95%, too much will give less power/color to the normal map too less will make it shine too much and make it ugly, again you will have to try and error but I say go for 95% on your first try.

Once you did this for all the textures you have to save them *_smdi.paa (again put this files where you declared on your config). Now open the model INSIDE O2 (not GateBuilder) and normalize (F5) all the lods.

Hopefully if you understood my tutorial (I'm Portuguese and English is my third Language) than it should be working, go try it in game

PS1: At the beginning this may seem complex but in reality it's extremely easy the problem is that a small mistake in the config file or while naming the normal mapped textures won't allow it to work and it will be very hard to spot the problem.

PS2: The values declared inside the config like the power are values that indicate the power/type/light and amount of normal maps, personally I didn't use them much but I may give you further assistance on this if you need me to.

For now just go try it and tell me if it worked, tell me also if you got this pm, since it's a large one I have a safe copy just in case.

Have fun and good luck, btw, next to normal maps I think you should make shadows which is even easier, I can teach you that also if you need me to.

Valvesoftware Normal Map Tutorial

If your texture is supposed to have depth to it, adding a normal map (successor of the bump map) will make the lighting on it far more realistic (This is perhaps the main reason Doom3, FarCry, and HL2 are able to look so much better than previous games). While bump maps only used one channel to decode the height of each pixel, normal maps use all three:

  • The blue channel decodes the height of the pixel (Z-axis)
  • The red channel contains the horizontal slope (X-axis)
  • The green channel includes the vertical slope (Y-axis)

With these 3 channels, every pixel has a normal vector, means the engine knows in which direction the pixel is facing and can thereby calculate shadows and highlights.

A normal map is kind of useless for really flat surfaces like smooth concrete or metal. But even rough concrete sometimes has enough depth to it to make a normal map worthwhile. This is an old article but explains the concept well: Normal Maps

The normal map should be created in the same dimensions as the image texture (color map) it will go with. There are a few options for how to create one, depending on the quality you want, your skill with various programs, or your patience.

Normal Map from an image editing program

Photoshop or Paint Shop Pro

Note: As of Jasc Paint Shop Pro version 9, the NVIDIA normal map plugin no longer works. Use Photoshop or GIMP instead.

If you have Photoshop or Paint Shop Pro, you can use NVIDIA's normal map tools, available here. To use them, open a copy of the texture and apply the Normal Map filter. Fiddle with the settings until you get something that you feel will be bumpy enough for your texture. The greater the range of colors, the greater the range of angles on the surface. A very flat surface will look that medium blue color all over. If you want to have more control over it, change the image to grayscale and fiddle with brightness and contrast to make certain details stand out before applying the filter. Be sure to change the texture back to RGB mode, or else the normal map tool will not work. Do this step multiple times to get different details to stand out, and then put the images together in layers with the blend mode set to overlay.

GIMP

Place the windows in a useful way. Download the tool for GIMP here and install it following the instructions in the readme.

After restarting GIMP, open a copy of the texture you want to create a normal map for and click:

Filters → Map → Normalmap…

Before starting, you should click the 3D Preview and place it next to the normalmap window. It will automatically update when you change your settings and will be a great help checking the results in GIMP. Select a shape similar to what your texture will be placed on ingame (e.g. a texture for brushes fits onto a cube whereas a modelskin might look better on a sphere). Make use of the UV scale to find a good setting. Now focus on the Normalmap window again. These are the most useful settings:

  • Filter - different ways to calculate your normal map. You'll have to try out which one works best for your texture
  • Minimum Z - the lowest height on your normal map
  • Scale - Use this to control the height of your surface. Results change when you choose a different filter
  • Conversion - Let's you choose what is used to create the normal map. Max/Min RGB or only one color channel can be very helpful sometimes

Checkboxes

  • Wrap - Normal map will pattern seamless. Definitely use it for map textures!
  • Invert X/Y - If your normal map seems to be upside down, this will help

Check the 3D Preview from several angles, also move the light around. When you've found the best setting, hit OK and your texture is converted to the normal map! You can either go with that right away or rework it by hand. For example, you could duplicate the layer and use some overlay effects (Dodge, Addition, …) or paint on the texture yourself if you want to create a flat part (RGB #7f7fff is flat).

Normal Map from a 3D program

XSI

Note: You need XSI foundation or higher to take advantage of this feature, as the Mod Tool has a resolution limit.

  • ver 3.5: GPU surface FX

The name has been changing, but the basic usage is the same:

  • Move the high resolution model over the low resolution model.
  • Select the low resolution one.
  • Select GPU Surface FX2 (or Ultimapper in ver 5.0) from Get>Property.
  • In GPU Surface FX2 menu:
  • Pick the high resolution model (or group).
  • Make sure normal is checked.
  • Change settings such as normal map resolution, path, sampling, as you want.
  • If you are ready, click Regenerate button. XSI will make the normal map.
  • To preview the result, set Preview Display and Hardware correctly and click Create Preview.
  • Important: It is necessary to invert the green channel of the output file. If you don't do this, your up/down normals will appear inverted in the engine. The simplest way to do this in Photoshop is to open a channel window, (window:channel) select the green channel (which controls up/down), and press Ctrl+I.

Getting the Normal Map in the Game

  1. Save your normal map as a TGA in the same resolution as the original texture. Give it a name that ends in _normal. Then convert it to a VTF. The _normal at the end of the name will affect how Vtex converts it. For the brick wall example, we would name the file brickwall_normal.tga. Place the new VTF in the same place as your original texture.
  2. Add this line to the VMT somewhere between the braces:
"$bumpmap" "texture name"

and fill in the path and name of your normal map VTF. Here's an example VMT for a normal-mapped material:

"LightmappedGeneric"
{
    "$basetexture" "walls/brickwall"
    "$surfaceprop" "brick"
    "$bumpmap" "walls/brickwall_normal"
}

Note: Multiple materials can use the same normal map file.

  1. When compiling your maps with vtex, Add this line to the <texture filename>.txt file in the same directory as your textures then compile with vtex.
"nocompress" "1"
"normal" "1"

See also

Creating Materials

Height2Normal

Source valvesoftware

Utils

This article lists all known Normal Map tools.

Normal Mappr

Normal Mappr by TomorrowPlusX topic here.

Enter NormalMappr!

It's document based ( and the dev version which I'll release soon handles batches ).

Document window:

Batch drag-n-drop window:

It's UB, and works pretty well. Below are links for the app and the source. Consider the source “free, as in speech (or whatever you want to do with it)”. That being said, batch operation isn't ready to roll yet so it's not included in the links below:

Here's the app:
http://zakariya.net/shamyl/etc/NormalMappr.app.zip

Here's the source:
http://zakariya.net/shamyl/etc/NormalMappr.zip

Let me know if you like it, or have any feedback for me.

(as a side note, I didn't just write it for myself. Somebody on Ars Technica's Macintosh Achaia (http://episteme.arstechnica.com/eve/...m/726000575831) expressed the same complaint with NMG as I felt, so I figured, why not write it.

Nvidia Tools

Nvidia tools are supposedly doing normal maps (automatically?), some filters or something. Check out Nvidia Adobe Photoshop Plug-ins.

Includes:

  • NVIDIA Normal Map Filter
  • NVIDIA DDS PLug-in
  • NVIDIA Mipster Script
  • NVIDIA Cube Map Shuffler

The Plug-ins

The NVIDIA Normal Map filter creates normal maps from height maps for per pixel rendering. The DDS plug-in supports the DXTC texture compression format and allows you to open and save .dds files in RGB format. It reads and writes .dds files compressed or uncompressed.

developer.nvidia.com_docs_io_20926_normalmapfilter.jpg

ATI Normal Mapper

Use ATI tool Normal Mapper to make your normal maps. Download it here. Normal Mapper generates normal (bump) maps from a high and low-resolution model.

freddern: I modified my vest texture a bit and made it grayscale before i used a plugin called xNormal → HeightToNormals and then I get a normal map.

There are also a lot of free normal map tools to derive 3d geometry data, like nvidias melody. These programs create normal maps with the help of high resolution 3d models having billions of polygons.

NormalMapCompressor

NormalMapCompressor

NormalMapCompressor is a useful tool to automatically compress your normal maps. This tool uses DirectX 9 (in .NET) to do the job and assumes that the normal maps are stored in the default xyz format (NVidia/Doom3 style, opposed to the ATI format where y is inverted). However, all normal map formats should work well with this tool (it doesn't care), but you might want to exchange the fx shader file for rendering.

www.codeproject.com_cs_media_normalmapcompressor_normalmapcompressor.jpg

Download NormalMapCompressor.

arma/texturing/normal_maps.1183959750.txt.gz · Last modified: 2007-07-10 09:52 (external edit)