Difference between revisions of "GIMP: Quality Normal Maps"

2,214 bytes added ,  08:24, 16 April 2010
no edit summary
imported>Qazaaq
imported>Darkness X
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[Category:Texturing_Tutorials]]
[[Category:Texturing_Tutorials]]
[[Category:Tutorials]]
[[Category:Tutorials]]
{{Tools|req0=[[GIMP]] + 2 Plugins|req1=[[BSA Unpackers]]|req2=[http://eliteforce2.filefront.com/file/DDS_Converter%3B29412 DDS Converter 2]}}


== Introduction ==
== Introduction ==
This tutorial is the process used to create great looking Normal Maps using GIMP. Normal Maps created using this process are as close to the actual Bethesda style used in TES:Oblivion as currently possible. They will also render great looking image textures with high quality light reflection. This article's purpose is to provide a easy to follow step-by-step instruction to create these high quality Normal Maps.
This tutorial is the process used to create decent looking normal maps for your models using [http://www.gimp.org/ GIMP]. Normal maps created using this process are not ideal, but will usually make a fairly nice normal map for most of your needs. This article's purpose is to provide a easy to follow step-by-step instruction to create normal maps.


::For more information on what Normal Maps are go here:
::For more information on normal maps, go here:
* Wikipedia http://en.wikipedia.org/wiki/Normal_mapping
* [http://en.wikipedia.org/wiki/Normal_mapping Wikipedia (Normal_mapping)]


::For more information on what GIMP is go here:
::For more information on GIMP, go here:
* GIMP.org http://www.gimp.org/
* [http://www.gimp.org/ GIMP.org]


== Getting Started ==
== 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.
Download and install the following applications if you have not done so already.


* GIMP 2.2.15 http://gimp-win.sourceforge.net/stable.html
* The latest version of [http://www.gimp.org/ GIMP]
* GIMP DDS PlugIn http://registry.gimp.org/plugin?id=4816
* [http://nifelheim.dyndns.org/~cocidius/dds/#download The GIMP DDS PlugIn]
* GIMP NVIDIA Normal Map PlugIn http://developer.nvidia.com/object/nv_texture_tools.html
* [http://nifelheim.dyndns.org/~cocidius/normalmap/#download The GIMP Normal Map Plugin]
* BSA Unpacker http://cs.elderscrolls.com/constwiki/index.php/BSA_Unpacker_Tutorial
* One of the many BSA unpackers ''[http://cs.elderscrolls.com/constwiki/index.php/BSA_Unpacker_Tutorial (more information here)]''
* DDS Converter 2.1 http://eliteforce2.filefront.com/file/DDS_Converter;29412
* [http://eliteforce2.filefront.com/file/DDS_Converter%3B29412 DDS Converter 2]


== Loading Your Image ==
== Loading Your Image ==
After downloading and installing all the applications you are now ready to begin. Let’s get started!
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)


'''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.''
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.
 
* 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"
* 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")
* 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.


== Preparing Your Image ==
* Load GIMP by double clicking the desktop link or clicking Start\All Programs\GIMP\GIMP 2
You must first Merge Down all your layers into a single layer. Then rename this layer to ‘main surface’.
* 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.


* Image Window: Layer\Merge Down (repeat until only one (1) layer remains)
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: Double Click the layer name
* Type: main surface (cap sensitive)
* Press Enter on the keyboard


'''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.''
* 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.
* 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.
* Go to Filters>>Map and select "Normalmap"
* You should get a dialog that looks like the following:


* Layer Dialog Window: Click the first layer named ‘mipmap#’
[[Image:NormalMapDialog.jpg]]
* 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’


== Creating Alpha Channel ==
''All these settings are correct, except possibly the wrap option (see appendix)''
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.


* Image Window: Layer\Transparency\Color to Alpha
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 Window: Click the long white bar next to ‘From:’
* Color to Alpha Color Picker Window: HTML Notation: Enter 000000


'''NOTE:''' ''If entered correctly, the current color will be Black.''
When you are satisfied with the level of detail, exit the 3D preview and click "OK" in the Normalmap dialog.


* Color to Alpha Color Picker Window: Click OK
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.
* Color to Alpha Window: Click OK


== Creating Normal Map ==
First, go to Layers>>Transparency, and select "Add Alpha Channel". Next, 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.
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!


* Image Window: Filters\Map\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 ‘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’


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.
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".


* Normalmap Window: Click OK
Now that you have finished your normal map, all that is left to do is save it.
* 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


== Converting Your Images to DDS Format ==
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").
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.


'''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.''
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.


* Load DDS Converter 2.1: Start\All Programs\DDS Converter 2\DDS Converter 2.1
* Open DDS Converter 2, and browse to choose your png or tga file (in this case boots_n.png)
* Click ‘Options’ located to the right of ‘Output Format’
* Click on the image in the window, and click on "Options..."
* Options Window: General\On success\cancel: Uncheck ‘Close DDS Converter 2’
* 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.
* DDS\DXTc format: Choose DXT3
* Once your options are set, just click "OK", and then save your image.
* DDS\Options: Checkmark ‘Build mipmaps’
* 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")''.
* 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


'''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.
Congratulations! You have successfully made a normal map. Check it out in the game to see your work come to life.


== Appendix ==
== Appendix ==
Line 118: Line 89:


'''Scale:''' This is the biggest factor in creating texture depth. 1-2 is smooth, 5-8 medium, 10 – 15 rough.
'''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:'''
'''Options:'''
* Wrap – ALWAYS USE THIS for textures that will be wrapped to a mesh.
* Wrap – Might need to be checked for textures to be applied to meshes, although I have never had a problem 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.
* 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.
* Swap RGB – Not used on Alpha Channels.
Anonymous user