Tutorial - Retexturing A Mesh Part 1c - Rendering a UV Unwrap (Optional)
Pre-Reqs:
Extract the necessary files to work with (link)
Basic understanding of using 3D editing software
A way to import DA:O meshes into your 3D software, such as the "DAO Model and Animation Import and Export" (link)
Embiggen: To view larger versions of the images below, see here.
This is an entirely optional step, but is one of those things that if you have the ability to do it, makes editing textures much easier. What we're going to do is use some 3D modelling software to load the textured mesh we've extracted from the game, and render out what is known as a "UV Unwrap". This is a map that shows how the 3D polygons of the mesh are mapped to the 2D space of the texture. If you can remember mapping out a cube into a flat drawing of six edge-joined squares in school, this is essentially the same thing, except for a much more complex shape made entirely out of triangles.
In this case, since it's what I have on hand and am familiar with, I'm going to use 3DS Max for this step. Most modern 3D editing tools have the capability to do this; it's all a question of you learning how to do it with whatever tool you have available and are comfortable using. Or skipping it entirely; it is, as I say, optional.
The first step is to go to our importer, and load any of the female versions of the mesh.
All of them will use the same mapping to the texture. The size and shape of the mesh polygons in 3D space has changed to reflect the size and shape of that race, but how each polygon maps to the texture to be applied is the same.
The default import settings are fine for what we want to do, so once the mesh has been chosen, all I need to select is the Import button under the "Import Meshes" and "Import Collision" check boxes:
And then I can see this mesh (and its simplified collision representation) in my editor.
In the stack menu on the right I can see I'm currently at a "Skin" parameter (which is where 3DS Max attaches a mesh to the invisible bones that animations drive). Underneath "Skin" is the paramter I need; "Unwrap". If there was no "Unwrap" in the stack, I could temporarily add one. In this case, all I need to do is click on the "Unwrap" paramter, ignore the warning message that pops up becasue there are things above it in the stack, and then click on the "Edit" button that appears under "Parameters" further down in the right-hand menu:
3DS Max will now open a floating window that shows how the mesh is mapped to the texture space.
We don't want to touch anything here; all we want to do is save this out as a usable texture. To do this, we go to the "Tools -> Render UVW Template" option.
We'll next be shown a dialog where we have some options we can set. Most of the default settings are fine, but we should uncheck "Show overlap" and "Seam Edges" as these are both things we don't need to see, and which will add unnecessary colours to our UV Unwrap texture.
Click on the "Render UV Template" button at the bottom of the dialog window, and a new floating window will pop up, containing a white-on-black rendering of the polygons:
Clicking on the little diskette icon at upper left of the window will allow us to save it out to our hard drive. I usually prefer to save to a non-lossy format such as BMP or TIF, so that we don't have things happening like JPGing artifacts blurring the lines.
This texture can then be layered over top of our diffuse texture in our texture editing software, so we can see where the lines of the mesh fall.
Notice how much of the detailing in the texture follows along the lines of the mesh; the edges of the bracer, the belt, where sewn seams are, etc. This gives crisper edges and usually less distortion. Note that in the majority of the texture, the colour extends some distance outside of the mesh lines; this allows for the fact that there will pretty much always be some minor variance between what we see here and how it will actually get applied in game (due to rounding errors with the values, if nothing else). Ever noticed a mesh in game where you could pick out a seam because there was a fuzzy intrusion of a wrong colour along it? That's a spot where the colour didn't extend far enough beyond the edges, and rounding errors/blurring are causing bleed through from the surrounding texture.
Note - I've included the unwraps for both the male and female versions of the clothing mesh as part of the photoset here, so even if you don't have access to 3D editing software, you can grab the textures from the photoset to use.
Last Modified: April 6, 2013










