Difference between revisions of "GIMP: Quality Normal Maps"

1,805 bytes added ,  17:49, 14 October 2009
Major clean and edit
imported>Gez
m (nVidia doesn't have a plugin for the Gimp.)
imported>Morerunes
(Major clean and edit)
 
== Introduction ==
This tutorial is the process used to create greatdecent looking Normalnormal Mapsmaps for your models using [http://www.gimp.org/ GIMP]. Normal Mapsmaps created using this process are asnot closeideal, tobut thewill actualusually Bethesdamake stylea usedfairly innice TES:Oblivionnormal asmap currentlyfor possible. They will also render great looking image textures with highmost qualityof lightyour reflectionneeds. This article's purpose is to provide a easy to follow step-by-step instruction to create these high quality Normalnormal Mapsmaps.
 
::For more information on whatnormal Normal Maps aremaps, go here:
* Wikipedia [http://en.wikipedia.org/wiki/Normal_mapping Wikipedia (Normal_mapping)]
 
::For more information on what GIMP is, go here:
* GIMP.org [http://www.gimp.org/ GIMP.org]
 
== Getting Started ==
Download and install the following applications if you have not done so already. To use this tutorial successfully I recommend using the versions I have listed.
 
* The latest version of [http://www.gimp.org/ GIMP]
If you have Adobe Photoshop:
* [http://nifelheim.dyndns.org/~cocidius/dds/#download The GIMP DDS PlugIn]
* Photoshop nVidia DDS & Normal Map PlugIn http://developer.nvidia.com/object/photoshop_dds_plugins.html
* [http://nifelheim.dyndns.org/~cocidius/normalmap/#download The GIMP Normal Map Plugin]
Otherwise:
* One of the many BSA unpackers ''[http://cs.elderscrolls.com/constwiki/index.php/BSA_Unpacker_Tutorial (more information here)]''
* GIMP 2.2.15 http://gimp-win.sourceforge.net/stable.html
* [http://eliteforce2.filefront.com/file/DDS_Converter%3B29412 DDS Converter 2]
* GIMP DDS PlugIn http://registry.gimp.org/plugin?id=4816
* GIMP Normal Map PlugIn http://nifelheim.dyndns.org/%7ecocidius/normalmap/
In all cases:
* BSA Unpacker http://cs.elderscrolls.com/constwiki/index.php/BSA_Unpacker_Tutorial
* DDS Converter 2.1 http://eliteforce2.filefront.com/file/DDS_Converter;29412
 
== Loading Your Image ==
After downloading and installing all the applications you are now ready to begin. Let’s get started!
* Load GIMP by double clicking the desktop link or clicking Start\All Programs\GIMP\GIMP 2
* Click File\Open (CTRL+O)
* Image Window: Click Dialog\Layers (CTRL+L)
 
First, you need to have a texture that you plan on using for a normal map. While normally this would be a custom texture of some sort, but for the purposes of this tutorial I will be using a pre-made texture, that already has a normal map.
'''NOTE:''' ''Your image must conform to the standard template used by Bethesda. This template requires that your image must contain a single layer for the image called ‘main surface’ and mipmaps.''
 
* Open up your BSA extracting software (personally I prefer the one packaged with Oblivion Mod Manager), and click the "Open" button. Browse to your Oblivion folder, and choose "Oblivion - Textures - Compressed.bsa"
== Preparing Your Image ==
* Once the BSA file is loaded, make sure no files are selected/checked, and then choose one texture to use as our base for the normal map. This can be any texture that does '''not''' end in "_n" or "_g". (Ex. "textures\armor\imperialwatch\m\boots.dds" '''not''' "textures\armor\imperialwatch\m\boots_n.dds")
You must first Merge Down all your layers into a single layer. Then rename this layer to ‘main surface’.
* Click "Extract" and choose a destination (such as your desktop). You have now chosen a texture to use as a base for a normal map.
 
We will now need to load this image in GIMP, our image editor.
* Image Window: Layer\Merge Down (repeat until only one (1) layer remains)
* Layer Dialog Window: Double Click the layer name
* Type: main surface (cap sensitive)
* Press Enter on the keyboard
 
* Load GIMP by double clicking the desktop link or clicking Start\All Programs\GIMP\GIMP 2
'''NOTE:''' ''Now you must remove any mipmaps that the image has. This is only necessary if you are creating a Normal Map from an existing Bethesda .dds file.''
* Click File\Open (CTRL+O), and choose the dds file that you extracted.
* You should be prompted with a dialog asking you if you want to load mipmaps, and if you want this dialog to be shown. Deselect "load mipmaps", and click "ok".
* The image you chose should appear in the image window. If it is only black and white, or mostly blue, then most likely you chose a glow or normal map, respectively, and you will need to extract a different image from the BSA file (again, one that '''does not''' end in "_g" or "_n"). If it is in full color, please proceed.
 
Now that you have your image open, you will need to make sure your image has been flattened, and run the normal map filter.
* Layer Dialog Window: Click the first layer named ‘mipmap#’
* Press the Trashcan icon located at the bottom right ‘Delete Layer’
* Repeat for each of the remaining mipmaps so that all that remains is ‘main surface’
 
* Make sure that either you have nothing selected, or that you have the entire image selected. Selecting only parts of the image may cause problems.
== Creating Alpha Channel ==
* Go to Layers>>Transparency and click on "Remove Alpha Channel". If this option is not available, then skip this step, as the image you loaded ''already does not have'' an alpha channel.
You must now add Alpha Channel to your image so that the Normal Map generator can easily distinguish the perception of height contained in your image.
* Go to Filters>>Map and select "Normalmap"
* You should get a dialog that looks like the following:
 
[[Image:NormalMapDialog.jpg]]
* Image Window: Layer\Transparency\Color to Alpha
* Color to Alpha Window: Click the long white bar next to ‘From:’
* Color to Alpha Color Picker Window: HTML Notation: Enter 000000
 
''All these settings are correct''
'''NOTE:''' ''If entered correctly, the current color will be Black.''
 
Using the settings from the image, you can start making modifications from there. For the most part, the only other setting you should change is the scale, which often is too low to be noticeable at "1.00000". I generally go with a scale between five and fifteen to get a noticeable effect. To get an idea of what your map will look like in-game, you can click the "3D Preview" button, and you should be able to rotate the plane in the 3D window by left-clicking and dragging your cursor, to see the effects light will have on your texture. The shine of your surface is not apparent in this preview, and is ignored, so do not worry if your wood appears shiny in the preview.
* Color to Alpha Color Picker Window: Click OK
* Color to Alpha Window: Click OK
 
When you are satisfied with the level of detail, exit the 3D preview and click "OK" in the Normalmap dialog.
== Creating Normal Map ==
Your image will now look ghostly compared to its original state. This means you have successfully converted gradients of black to your Alpha Channel. Good Job! Now to create the Normal Map!
 
You have now created the "directional" part of your normal map, but the other part of your normal map is shininess. This is determined by the transparency of the parts of the normal map (or the "Alpha Channel" as it is technically called). The more opaque a pixel is, the shinier it will be in-game, and likewise the more transparent a pixel is, the less shiny it will be.
* Image Window: Filters\Map\Normalmap…
* Normalmap Window: Click ‘3D Preview’ button
* Normalmap-3D Preview Window: Hold the Left Mouse Button over the preview window and drag upward so the Quad tilts back.
* Click the light bulb icon at the top left (Rotate Light)
* Hold the Left Mouse Button over the preview window and drag toward the lower right until you can see good shadow contrast.
* Click the sphere icon next to the light bulb icon (Rotate Object)
* Normalmap Window: Options – Wrap – Add Checkmark
* Filter: Pull Down Menu – Select ‘3x3’
* Scale: 6.00000
* Height source: Pull Down Menu – Select ‘Alpha’
* Alpha channel: Default ‘Unchanged’
* DU/DV map: Default ‘None’
 
Select areas of your normal map that should have less shine to them, and then click on the "Eraser" tool. Under the settings, make sure the opacity is '''not''' set to 100%, as this will also get rid of your directional data. I repeat, '''make sure the opacity setting is below 100%'''. A value of 90% is usually pretty good for rough woods, and a value of 85% for shinier woods. Material such as leather should be set even higher (higher opacity on the eraser will make pixels more transparent, and likewise less shiny). If you click and drag to erase all of the pixels you have selected at once, you should not run into any problems, however if you let go of the left mouse button, and then continue erasing, you may erase the pixels completely and therefore get rid of your directional data, which will ultimately make your normal map useless. An easy way to check this is by looking at the "Channels" dialog, and making sure there is no solid black in the color channels (not the alpha channel). If there is solid black, you should undo your erasing and start over, being careful not to let go of the left mouse button as you erase. You may still see a faint ghost-image remaining where you erase, and this is a '''good thing''', however do not be worried if you do not, it just means the opacity of the eraser was rather high.
Now go back to the Normalmap – 3D Preview window and see the difference. You should now be able to clearly see the texture in the image. You have successfully created a high quality Normalmap.
 
''A value above 95% on the eraser may eliminate some directional data, although I am not sure why, so be careful.''
* Normalmap Window: Click OK
* Image Window: File\Save As (SHIFT+CTRL+S)
* Save Image Window: Rename your file using the original image name but add _n.tga at the end. [Example] Original: myimage.dds ; Becomes: myimage_n.tga
* Choose the same directory as your original image.
* Click Save
* Save as TGA Window: Uncheck ‘RLE compression’ and Uncheck ‘Origin at bottom left’
* Click OK
 
Once you have done that, you should be essentially done! There is still one more thing that could be done to your normal map though, but is not necessary. If there are many sharp edges on the normal map (lots of high contrast areas or lines), then you may want to run a blur filter over it to smooth things out a bit. You can do this by going to Filter>>Blur and selecting "Blur".
== Converting Your Images to DDS Format ==
DDS is the image format used by the Gamebryo Element Game Engine for texturing meshes. Your image files must be in the .dds format to render in the game. To avoid confusion and a debugging nightmare it’s HIGHLY RECOMMENDED that you follow the same directory structure as created by Bethesda when saving your image or mesh files.
 
Now that you have finished your normal map, all that is left to do is save it.
'''NOTE:''' ''We will not be using the DDS Export PlugIn that was installed into GIMP to convert our files to DDS format. Reason is that problems have been seen with using the GIMP converter and it is HIGHLY RECOMMEND using an external converter. If the external converter is not used, the textures can look checkered in game, and will look horrible under high lighting conditions. However, using the GIMP converter to import DDS files works fine.''
 
While you can technically save your image to a dds from within GIMP, I would advise against it as it tends to make buggy/low quality textures for Oblivion. Instead, I would save it to either a jpeg or a png file. For a normal map, you '''must''' save it to an image that supports an alpha channel. You can use tga, but I prefer png because it is a widely used image format with very good lossless compression, as oppose to tga which is uncompressed (and tends to make very large files). Make sure that when you are saving your image, the name is the same as the base texture (in this case "boots.png"), but add a "_n" to the end of the name ("boots_n.png").
* Load DDS Converter 2.1: Start\All Programs\DDS Converter 2\DDS Converter 2.1
* Click ‘Options’ located to the right of ‘Output Format’
* Options Window: General\On success\cancel: Uncheck ‘Close DDS Converter 2’
* DDS\DXTc format: Choose DXT3
* DDS\Options: Checkmark ‘Build mipmaps’
* DDS\Options: Number: 9
* Click OK
* Use the ‘Look In’ pull down menu to find the directory that your images are saved in.
* Choose your original image file name in the list box. [Example: myimage.dds]
* Check that the ‘Output format:’ Says ‘DirectDraw Surface (*.dds)’
* Click Convert
* Progress Window: Click Restart
* Choose your _n.tga file name in the list box. [Example: myimage_n.dds]
* Click Convert
* Progress Window: Click Close
 
Since Oblivion will only read dds image files, you will need to use a converter to convert your png or tga file to a dds file. In this case I will assume you are using DDS Converter 2.
'''CONGRATULATIONS!''' Your original image and Normal Map have been converted to .dds format and they are ready to be applied to a mesh. Search this Wiki for tutorials on skinning meshes if you need help with that topic.
 
* Open DDS Converter 2, and browse to choose your png or tga file (in this case boots_n.png)
* Click on the image in the window, and click on "Options..."
* In the options dialog, you can leave all the settings at default (refer to [http://cs.elderscrolls.com/constwiki/index.php/Image:DdsConverterOptionsDialog.jpg this image if necessary]), except make sure that "DXT3", "Build mipmaps", and "Save Alpha" are all checked/selected. If this were a normal texture (not a normal map), then we would want DXT1a without alpha checked.
* Once your options are set, just click "OK", and then save your image.
* Your result should be a dds file called "boots_n.dds" ''(or "yourTextureNameHere_n.dds")'', and should be placed in the same directory as your base texture ''("boots.dds" or "yourTextureNameHere.dds")''.
 
Congratulations! You have successfully made a normal map. Check it out in the game to see your work come to life.
 
== Appendix ==
 
'''Scale:''' This is the biggest factor in creating texture depth. 1-2 is smooth, 5-8 medium, 10 – 15 rough.
 
'''Height source:''' We are using Alpha Channel
 
'''Alpha Channel:''' Leave this as Unchanged.
 
'''DU/DV map:''' Choose a different map to create some interesting textures.
 
'''Options:'''
* Wrap – ALWAYSMight USEneed THISto be checked for textures that willto be wrappedapplied to meshes, although I have never had a meshproblem not doing so.
* Invert X/Invert Y – These invert the shading on the specified axis. Selecting both of these will fix a texture that seems to be inside out.
* Swap RGB – Not used on Alpha Channels.
Anonymous user