swtor materials and texture files - SWTOR-Slicers/WikiPedia Wiki

A look at SWTOR's 3D materials and their texture files (WIP)

  1. SWTOR's texture map types

  2. SWTOR's material types and how they use the texture maps (WIP)

SWTOR'S TEXTURE MAP TYPES

These are the main types of texture maps SWTOR uses. As per BioWare's naming conventions for SWTOR, typically there is a suffix before the extension (quite useful when doing searches) such as _d.dds, _n.dds, etc. In other cases there is a prefix that usually is more self-explanatory than technically rigorous: for example, although there are files prefixed with pattern_, facepaint_, makeup_ and tattoo_ they all are used in the same way and in the same material input.

So, each of the following entries are written as: suffix or prefix in filename, internal name in materials' attributes and others, and a short description.

Prefix/Suffix Label description
_d DiffuseMap diffuse color as RGB, plus rim light exclusion mask
_h PaletteMap diffuse color as Hue/Saturation/Lightness + Ambient Occlusion
_m PaletteMaskMap primary and secondary hueing masks plus metallic reflectivity mask
_n RotationMap normal map, plus emissiveness and opacity maps
_s GlossMap specular color and shininess (not PBR-style!)
facepaint_pattern_tattoo_makeup_ FacepaintMap tattoos, make-ups, skin and fur patterns, etc.
complexion_ ComplexionMap complexion and Dark Side corruption maps
age_ AgeMap scars and age wrinkles' normal maps
facehair_ FaceHair exact usage unknown
wrinkles_ _wwrinkles_ _wm AnimatedWrinkleMapAnimatedWrinkleMask animated facial wrinkles

The way the game's materials system uses them can get to be a bit convoluted. The .gr2 importer add-on for Blender adds template materials that handle all that complexity for us. Still, it's good to know what's what (especially if we use a different 3D app and want to build an approximation to the game's workings).

All texture map files are meant to be used as non-color corrected images, and must be handled so in Blender and other DCC apps (using "raw", "non color", or equivalent settings). This is especially critical for files that contain actual non-color data such as normal maps. This means that, at some point in the shading and rendering process, some sort of colorspace correction becomes necessary (conversion to sRGB, gamma adjustments, etc.). The Blender add-on's template materials include a gamma correction.


_d ("DiffuseMap"): object's diffuse color as RGB.

The diffuse color texture is shown in full in objects that use the Creature and Uber shader material (creatures, furniture, architectural and landscape objects, mainly). For objects that are recolorable (either pre-colored or dyeable), the game masks areas of the object and uses a more complicated system to color them, leaving the DiffuseMap show in the unmasked areas if any.

Regarding the alpha channel (if present), it seems to have different uses depending on the object it belongs to and the shader which will use it. In the case of the Skin shader and characters' head objects, it masks the eyes, nostrils, and mouth areas to keep them from being affected by SWTOR's simulated rim lighting (an effect not yet implemented in Blender but already tested in Unreal).


_h ("PaletteMap"): object's diffuse color as Hue/Saturation/Lightness + Ambient Occlusion.

These HSL+AO textures constitute the base colors for all the "dyeable" areas of the game objects (be it preset by default or applied through player-adquired dyes). Non dyeable areas in an object show the _d DiffuseMap texture colors instead.

The alpha's Lightness defines most of the object's soft shadowing: it is very much like a grayscale version of the _d diffuse map. If SWTOR's re-coloring system can't be replicated, a very simplistic but fairly effective approach would be to multiply this alpha channel by a color (the skin color, dyes's ones, etc.).


_m ("PaletteMaskMap"): primary and secondary hueing masks plus metallic reflectivity mask.

The areas covered by the Palette1 and Palette2 masks disregard the DiffuseMap and use the _h PaletteMap's HSL+AO coloring system, instead. The rest shows the original _d DiffuseMask's RGB colors (for example, the insides of a character's mouth, or a piece of armor's non-dyeable areas).


_n ("RotationMap"): object's normal map (plus emissiveness and opacity maps).

Conversely, to build a conventional "blue" Normal Map out of that data, one would use:

The reason SWTOR's normal maps are "green" instead of the conventional "blue" is actually out of common Windows DirectX game development practices regarding the DDS image format: as the specific .dds variant used in SWTOR uses lossy compression with different degrees of compression per channel (it takes advantage of our eyes' different sensitivity to red, green and blue color resolution), it's typical to rearrange the normal map's channels to avoid the ones where compression is most damaging. See: http://wiki.polycount.com/wiki/Normal_Map_Compression

Also, DirectX's normals differ from OpenGL's ones (typical in 3D DCC apps such as Blender) in having the green channel inverted. See: https://docs.substance3d.com/bake/what-is-the-difference-between-the-opengl-and-directx-normal-format-182256965.html If converting a material to a DirectX application such as Tabletop Simulator, don't invert this channel.


_s ("GlossMap"): object's glossiness.

These textures aren't modern physically based rendering-type (PBR) ones but old-style glossiness ones and require some massaging before being fed to modern shaders such as the typical Principled BSDF Shader.


facepaint_ / pattern_ / tattoo_ / makeup_ ("FacepaintMap"): tattoos and make-ups, Twi'lek lekku and Cathar fur patterns, NPCs skin aging and markings.

Image with an opacity map. Even if the game only has facepaint maps for the characters' heads, one could easily create maps for the rest of the body parts and apply them in the same manner in order to have, say, full body tattoos and the like.


complexion_ ("ComplexionMap"):

Image applied as a Photoshop-like Multiply layer transfer mode over the results of other textures.

There are two Dark Side Corruption variants for each Dark Side character's complexion.

Note that even if the game only has complexion maps for the characters' heads, one could easily create maps for the rest of the body parts and apply them in the same manner.


age_ ("AgeMap"): scars and agings' normal maps (see RotationMap).

Normal map meant to be blended with the _n RotationMap one. The blending seems to use an overlay-type approximation.

(We haven't implemented it yet in our material templates for Blender 🙁).


facehair_ ("FaceHair").

The folder contains only a single pair of DiffuseMap and RotationMap with flat values in their channels. Actually useful in any way? (YET TO BE VERIFIED).


wrinkles_: maps for facial wrinkle animations.

Two types of files:

The .mat files include animatedWrinkleIntensity values and animatedWrinkleMult1 and animatedWrinkleMult2 vector4 values. INVESTIGATE


Other maps that need determining their functioning:

LookupTables: hairs use them as "DirectionMap".

Miscellanea:

Eyecubemap.dds seems to be the cubic environment map Bioware is currently using for the eyes' main catchlights, mixed in some manner and to some degree with the environment maps corresponding to each locale in the game.

Blender doesn't understand the typical "cross"-style cubic sky maps formats, so their use requires conversion.


SWTOR'S MATERIAL TYPES AND HOW THEY USE THE TEXTURE MAPS

(WIP)

Types of materials

Grosso modo, SWTOR has two types of materials: those that have a fixed color and those that are re-colorable.

Once again, we are following BioWare's terminology for them, as that helps when determining which model uses what material type. SWTOR's basic materials (basic shaders, actually, although it's more useful to think about them at the materials level when implementing and using them in a 3D app such as Blender) are:

Fixed color materials:

Re-colorable materials:

How does the re-coloring work?

Skipping the precise details for now, it goes like this:

(By the way: alongside the color modification information for each PaletteMaskMap area there is also glossiness's specular and metallic strength values)