How to create textures

From Dragon Age Toolset Wiki
Jump to: navigation, search

How to make a texture for an item

Overview

This tutorial requires GIMP. You can also use Photoshop’s dds plugin, it doesn’t matter, but this tutorial is for GIMP.

First extract base game textures manually from the game’s ERFs. This page will explain how to extract the textures from the game.

Textures used in Origins

Textures (4) There are four textures in an Origins item. Sometimes, for creatures or items, there is no specific specular or tint, but these are generally what they are.

Diffuse- the one that you typically think of as the texture.

Normal map – (Purple in most games. Grey in Origins. Orange in Dragon Age 2. ) This makes the shading engine of the game bounce light off the item in a way that makes the object look like it has more depth than it does.

Specular – this decides what parts of the object are shiny and which aren’t. It also decides what colour the object reflects.

Tint- this decides what optional colour tints are overlaid, giving the outfit different colour choices. It also tells the game what is skin, so darker skin tones know to have colour overlaid on them.

Each file will have a prefix. ‘pm’ and ‘pf’ mean the texture is universal for all males and all females respectively. Other items could have ‘hf’ for a human only variant for example.

LOD textures

A lod stands for level of detail. Origins has LOD_0 (cutscene distance), LOD_2 (mid distance, like in the party camp) and LOD_3 (very far away. All new modded in meshes don't need a LOD3 model as the engine will compensate and load in the LOD_2 model if a LOD_3 is not available.). Props and certain creatures like dragons have no LODS and are always experienced at LOD_0.

You should make LOD textures for your replacer or the item will swap to a different texture once you get far away from it. Simply resize all your files and save as according to whatever you are replacing, which will be something like pf_rob_appa_0dl2, pf_rob_appa_0tl3. (see below for file sizes and formats.) If you are making a texture for a modded in armour, you may want to check the .MAO file to see what the textures are called. The normal map is generally dropped from a distance to save space so you may not need to make LODs for it. Face textures are an exception however.

Saving options

File sizes

The textures need to be perfect squares, or perfect rectangles. This is because computers work to the power of 2 and prefer things that way. Not remembering this can make people’s games crash.

The game's default textures for most items are 1024x1024, but modern computers can handle a lot more so I would recommend working 2048x2048 at least. 4096X4096 is overkill, but you can do it. You can also have 2048 by 1024 and so on.

Example sizes:

128 , 256 , 512 , 1024 , 2048 , 4096

Saving formats - the basics

Dtx5 option

Use DTX5 compression for anything with an alpha- diffuses, normal maps, speculars. If something has an alpha, it may have transparent elements (cutouts around fur or feathers) or look transparent.

If something has no transparent elements, such as a diffuse with no fur or feathers, DXT1 can be used instead, which takes up less space. Technically speaking it has an alpha channel, but it's pure black and white.

Use U8888 for tint maps, hair textures, tattoos. It is uncompressed and therefore very large. You can create it by selecting [none] under compression options.




Saving formats- Advanced


DDS Formats

All DDS formats here use the same compression in the RGB channels; the only difference is in the alpha channel treatment DXT1 = technically speaking has an alpha channel but it's pure black and white. Use for diffuse textures that don't need an alpha channel (mostly).

DXT1a = uses the alpha channel, but black pixels in it will also be black in the RGB channels DXT1c = does not use the alpha channel

DXT3 = 4-bit uncompressed alpha channel. Generally not used in DAO, but in some cases it can be useful (alpha-wise) since it can provide less artefacts - but it will ruin gradients. DXT5 = 8-bit alpha channel compressed much like the RGB channels. Alpha channel will have compression artefacts but will not ruin smooth gradients.


The uncompressed formats:

u8888 = uncompressed 8bit ARGB. Large file size, use only for things you absolutely do not want compression artefacts on. In vanilla usage it pretty much only shows up in face tattoos. (Never use a compressed format for tattoos, the compression where they overlap will look awful.)

u4444 = uncompressed 4bit ARGB. Not as large as u8888, but only 4bit so gradients get banding (like in the alpha channel of DXT3). Used in vanilla for item tint maps. (Generally try to avoid compressed formats for item tint maps, but it's not as bad as with tattoos because the overlap is much more minimal, and you'll only get compression artefacts where the tint areas bump up against each other.)


Mipmaps

Always tick ‘Generate mipmaps’. You need mipmaps on anything that could move closer or further away to the camera, the only case you don’t need them is static elements like the UI. Things that don’t have mipmaps will have an odd ‘sparkle’ to them, instead of a smooth clean appearance.

The Compressonator

This is a Dragon Age Origins texture tool. Under tools\ResourceBuild\Processors\Texture in the DAO install directory you will find a tool called TheCompressonator. You can use this to check what compression a dds file has and if it has mipmaps or not. Drag the dds into it, and use view -> properties.

Make a diffuse

Fairly straightforward, this is the part of the texture that has the colour and shading on it. If you intend the item to be tintable, to come in different colours, you will need to make those parts greyscale or muted, as colour will be overlaid on top of them.

Make a normal map

Normal maps are textures that tell the shader to treat the surface as though certain pixels are pointing in a certain direction. It's basically used to "fake" higher detail level on lower-detail meshes.

You can generate an industry standard purple normal map using tools, from a heightmap, or less optimally from the diffuse. GIMP has a normal map plugin and there are other online tools, such as Normalize, that will do this free. Origins has an older format for normal maps (you will recognise it as being grey instead of purple) that needs to be converted to in order to work properly.

Once you have the purple normal map: Go to the toolbar of GIMP and Colours>Components>Decompose the purple thing.

You can decompose it to RGB (or RGBA it doesn’t matter, most normal maps do not have an alpha channel. Origins normal maps always do, however) It will now become 3 images, two grey ones and one white. Possibly another white one for the alpha. Delete the white layers, you don’t need them. One of these grey ones, the X axis, will be lit from side to side (probably the red one), and the other will be your Y axis, from top to bottom. Origins maps are set up to have the X axis in the alpha channel, and the Y axis in the RGB channels.


To modify a standard purple normal map to Origins format:

How to decompose an image

Decompose it. Identify which is the X axis and which is the Y Rename the X axis one Alpha. Invert the Y channel one, the RGB, so it looks as though it is inside out.

Colours>Components>Compose Compose colour model, RGBA

How to recompose an image


Put the x axis in the alpha slot Put the y axis in the RGB slots Compose

Save as dxt5. It should now be transparent, grey, and ready to use.

Convert da2 normal map

You don’t need to, they work fine in Origins. Even though they’re orange. This is because the engine of both games only reads the green channel and the alpha channel.

Convert Inquisition normal map

If they are green, they don't need the rgb channel inverting. (They are green because the blue channel has black in it instead of white, as purple normal maps do.)


Common problems with Normal maps

If you are generating a normal map from a diffuse, you need to remember that the lighter something is, the more it will push out, and the darker it is, the more it will recede. This can result in strange features, such as freckles or moles going in instead of out on a face texture, or shading cutting into skin.

You may be better off creating a height map. It is a monochrome image set up according to the darker = further in rule. So in the face texture example above, a heightmap for a face might have a dark face with a light mole and no or minimal shading on it. This will get better results than generating off the diffuse image.

How to Paint your own normal map

Take a regular Origins map.

Decompose

Rename alpha -> red,

invert green channel,

fill blue slot with white

Compose.

It will turn purple. You can now use the clone tool or draw on it in the same colours and when you convert it back to origins normal map, it should work the same way.

Make a specular map

Take the diffuse map, convert to greyscale (except parts you want to glow different colours, such as gold sections) and play with the levels. The whiter it is the shinier it will be in game. Black out anything you don't want to be shiny. This is your RGB. The rgb decides the colours the spec map reflects. Generally you will want this to be greyscale, except for details such as gold jewellery.

Import it into GIMP. Decompose as RGB.

Add a new layer. This is your alpha.

The alpha of the spec decides how shiny everything is overall, by how bright it is. White is full shine. Greyer and blacker saturation will make the overall effect more muted. You can also have a more detailed specular alpha , if you don't want a uniform level of shine. Check speculars from the game to see how they work.

Compose. It may be partially transparent now. Save as dxt5.

You can also have a spec with no alpha, the game doesn’t mind so long as there actually is one.

Make a tint map.

What a tint map will look like depends on what the tint map you're replacing is.

You need 4 images. These will be your red, blue, green and alpha channels.


How to make red, green, blue

You need to make 3 images, one for each shade you want tinted. Simply take the diffuse, turn it greyscale and paint over it. Black out anything you don't want affected, such as the metal parts.

Don't worry about these being the right hue, GIMP will turn them greyscale anyway.

If you don’t want the item to be tintable, create 3 all black images to be your red, blue and green. How the item tints depends on items like it, other robes and such. Use the items from the game as reference.


How to make Alpha Channel

Alpha channel contains the information of what skin is showing. To make this, Create a completely black layer, but with a totally transparent or pure white(#fffff). cut-out on anything you want skin tinted. Technically the body skin tint is #dedede, but #ffffff is the standard for Origins skin tint. When >composed, it should flip inside out, leaving black shapes on a transparent background.

Skin needs to be a specific colour on the diffuse to be tinted. If in doubt, just copy and paste the textures from the original nude file of the game. If the texture doesn’t have skin in it, leave the alpha channel black.

Create the tint map

Import one of your images into gimp, anything the right size. Decompose it. Delete your layers, then paste in the four you have made. Then, compose the image. Make sure they are in the right slots. When done, you can check the channels tab to see if what you did worked. Ideally, save as u8888 for the LOD0 and dtx5 for LOD2&3.


Information for Upscaling

This is written for use with ESRGAN:

• Always separate your alpha channel first. Some upscaling software allows you to do this inside the program, for some you have to do it manually. If you don't, a lot of upscalers will interpret it as black areas, and you'll get haloing.

• Always use a "de-compressor" model first. DDS compression not only creates jagged bits, it distorts the colours due to using one less bit for the green channel than red/blue, so you don't want to double-down on the compression when you save out again. Examples are Alsa for diffuses and BlueAmulet for normal map channels, from this database. Also for normal maps is FSBox_Pandalism, hosted on the Enhance Everything discord server. You de-compress the normal map channels, re-compile the normal map into a "purple" texture (you may also wish to flip the green channel as the the model may expects opengl-direction normals rather than directx, which is what dao uses) then run it through pandalism. You may also want to run it through BCGone_Smooth in case it introduces some jaggies.

• Most models will introduce some colour distortion. ChaiNNer is a newish upscaling software that's still in alpha but very functional - it has a node approach, and one of those is Average Colour Fix. You may or may not want to use it for the rest of the upscaling process, but that node is a godsend.

Should you scale up normal maps if you're scaling up the diffuse?

In general a normal map is just as important as a diffuse and should be upscaled along side it. But whether you should upscale something at all depends on what it is. DAO is not a game with a huge amount of memory, so you may wish to only upscale hero assets such as weapons, and leave things such as furs on the ground as 1k at most- and even then 512 might be more appropriate.

Other options

MAO editing

If you want a specific item to use a different texture, you will need to open a mao and change the texture file directories. Put the new Mao in your override along with your new textures and it will change the textures for you. This has little chance of conflict as comparatively few mods overwrite the maos, so I would recommend it. You can just open these in notepad.

MMH editing

If you want an item to use a different mao, such as many items that share textures between the races, you need to open the item’s mmh and change a directory there. This is not recommended except in specific cases as a lot of people use replacers, such as tmps proportion mods for females, that will overwrite the vanilla clothing mmhs.

Common problems

My item is turquoise or otherwise looks weird?

Are you sure you have every texture in the override, and everything in your mao is correctly spelled?

My item is shiny? One of your textures might be missing, or the specular has gone wrong.

My item is green AND t-posing!

Did you touch the mmh’s mao file directory? You might have spelled something wrong. Alternately your mao may be missing, or absent a crucial texture like a normal map.

My transparency/tint isn’t working on my new item no matter what I do to the texture!

Does your MAO use the right semantic? You want AlphaArmourSkinTint for things with both transparency and skin tinting for example - check maos of similar items to see what they look like.

Half my item is dark and the other half is light!

Your normal map is broken.

I can’t match the skin tone no matter what I do!

The skin on the vanilla neck texture isn’t the correct skin tint colour, so you probably can’t anyway. You might want to download one of the patchy skin fix mods on the Nexus.

The male version of this is too shiny?

Yes, the mao gives some of the male ones a higher shine value(mml_fSpecularReflectionMult) to the female one. I don’t know why. Alter the mao or darken your spec to compensate.

Texture Tools

Bounding box software- materialise – For making Normal Maps from scratch

DA Normal Map Conversion Photoshop Actions- Automates normal map conversions in Photoshop

DAO Clothing References - PDF file (references)- theskymoves

Beerfish Excel Utilities (references)

Optimizer Textures (Ordenador)- process textures fast

Useful Links

Texture_Formats

Reskinning_an_item_tutorial

Modding dao item texture guide – Good beginning, although not finished. 1 2 3

Mike Pickton retexture item

Mike Pickton Get item in game -for when you have the textures and want to put them on a new item

Convert Inquisition normal maps

Dragon age texture guide – Exhaustive

Some texture basics

How to create a tattoo

How to make Tattoos