[English] How to adjust Texture Mapping

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • [English] How to adjust Texture Mapping

      Hey! As per request, I will now give a bit of an intro on how to adjust what parts of a texture are mapped what parts of the model.
      There likely are more complete ways, for example using Blender, or 3DS Max which natively supports .nif files, however so far in my experience Blender has its issues dealing with Guild 2 .nifs even with plugins, and 3DS Max is a very pricey piece of software to use for modding, so I'm sticking to a simpler tool: NifSkope.
      If you need NifSkope, you can get it here: niftools.sourceforge.net/wiki/NifSkope

      Upon launching NifSkope, you can open up a .nif file using File>Open in the upper left, after which you should see a similar sight to what you see below, minus the two smaller square windows (and arrows, naturally).
      Below the image, I'll go through the relevant parts of the software point by point, using the numbered arrows to guide you.
      This example will be using the (Vanilla) thief_f.nif file stored in Objects/Characters, as well as the corresponding cm_thief_f_body_01.dds which is stored in the Textures folder.

      1 - This button isn't necessary to use, however it might be visually helpful. Guild 2 models for the most part come in multiple LOD-s (Levels of Detail), which the game switches between invisibly as the camera gets closer or further from characters. This button simply governs whether NifSkope will mimic this behavior or not. When it is off like in the image, only one LOD is rendered (though all are accessible on the left, we'll get to it). It might be useful to turn it on, if you want to see which LOD you selected on the left represented visually.

      2 - Similar to 1, this is optional, in fact, very much irrelevant here, except for an important note if you ever wish to adjust the models in other ways with NifSkope. That button governs whether or not the model is in its default T-Pose, or if it's in the default pose of the animation rig assigned to it. If you plan to do any adjustments to the actual model itself, make sure it looks right with that button turned on, as sometimes, while fine in T-Pose, the model may give surprising results in actual animation.


      Moving onto the relevant stuff:

      3 - As mentioned before, most character models and also some object models in Guild 2 come in multiple LODs. On the left there, is where the .nif's data "blocks" are listed, and of special interest are these LOD NiNodes.
      If you plan to adjust the texturing on a model, keep in mind that you'll usually need to repeat the same adjustments on multiple LODs. However, some LODs are so rough around the edges, that they barely qualify as stick figures, being intended to be the view of objects/Characters from halfway across the map, so using the button described in point (1) may give you a good idea whether or not a given model is really worth the effort, or if it's best to just leave it alone.
      You do not actually need to do anything with these NiNodes, but keep an eye out for NiNodes labeled LOD[number], to know in advance whether you'll need to repeat the process.

      4 - The actual parts of the .nif file you want to alter are these NiTriShapes. These are essentially what contains most of the actual model data in the .nif, with the rest taking up room for animation rigs, various flags used by the game to know what's what, etc.
      For characters, each LOD likely comes with 3 NiTriShapes, or 4 if it's a female model. Sometimes it can be more, sometimes it can be less. If a character wears a Helm/Hat or Hair, that is stored in a separate .nif called hairlibrary.nif for hairs, or hatlibrary.nif of helms/hats. Both of those are in Objects/Characters.
      The 3+1 usual NiTriShapes correspond to the body, the head, the eyes and in case of female models: The eyelashes.
      You probably only want to edit the body or the head. You can edit only that, it won't mess with the other 2 or 3 parts.

      Right clicking one of these NiTriShapes brings up a couple of options. (You can also right click the rendered model in the main window, but it's advisable to click in the block list on the left, so you know for sure you clicked the correct thing. Sometimes, especially if multiple LOD-s are displayed at once, it's easy to get confused.)
      The option you need to re-adjust the texture map is "Texture>Edit UV". This will bring up the window pointed out in the next point.


      5 - This window, is the UV editor. Ignore the second version of the window n the left for now. Before I say anything about it, know that it has a bad habit of closing as soon as you click anywhere outside of it, and this includes clicking on NifSkope's icon in the system tray, if you switched to a different window. If you are using NifSkope while also looking at something else (either the texture, this guide or anything else), a quick work around is to have NifSkope on one side of your screen, and whatever else you're looking at on another. The UV Editor won't close until you click on something inside NifSkope itself, other than the UV Editor.

      The green nets of green lines displayed inside it, are the triangles that make up the surface of the model you can see in the back view, cut up into sets. One word I want you to remember, as I will use it, is "vertex". This is essentially just the name for the corners of the triangles. You can click each vertex individually, and then if you click them again and hold, you can move them around. However, you probably want to move them in a more organized fashion, so here's a more in-depth look on this window:
      The bright gray square, where in this model you can see most of the green nets laid out, is essentially where you should imagine the texture is also located. So, if you look at point (6) which is the actual cm_thief_f_body_01.dds texture, if you mentally move it where the bright gray square is, you can start to see which triangles use what part of the texture to find out what they're supposed to show in-game.

      So, for example the large net of green triangles, which is close to the upper left corner of the bright gray area, just next to what looks like a column or a ruler, is entirely above the white, folded cloth looking texture in the upper left of cm_thief_f_body_01.dds. As a matter of fact, that set of triangles, are the ones that make up the arms of the female thief character.

      It should be noted, that the green triangles outside of the bright gray area aren't there by mistake, and in fact, you should always zoom out when editing a new object in this view, to see if there is any of them outside of the bright gray area.
      As a matter of fact, the only reason they are out of there, is to easily distinguish between parts of the model that is assigned to the same part of the texture. Just as you imagined moving the texture (again, the one pointed to by arrow (6)) to be over the light gray square, you should imagine, that the same texture repeats over and over again in every direction.
      Essentially, if you moved any of these triangles or groups of triangles to the left or right, or up or down by exactly as much as is the size of the bright triangle, then it wouldn't change one bit what they look like in-game, as when the game actually loads in, it virtually moves the triangles outside of that rectangle into the bright gray square by moves sized equal to the square itself.
      You can mimic the same thing, by clicking one of the vertexes, then right clicking it and selecting the option "Select Connected". This will select every vertex, and as a result, every triangle that is connected to the vertex you clicked. At this point, you can either click and drag them, or if you want to be precise, right click again and select "Scale and Translate Selected" (or just press Alt+S). This will allow you to scale and move all the vertexes you selected at once.
      Scaling is either done uniformly (will increase/decrease horizontally and vertically by the same amount) or by un-ticking "Uniform scaling", separately for the horizontal X and vertical Y axis.
      Moving (translation) takes movement on the X and Y axis as a variable. The direction is always "positive number push right and down, negative numbers push left and up".
      To my experience, moving vertexes by multiples of 2 in either or both axis will result in having them move by one repeat of the texture. So essentially, if you move the triangles by that much, the part of the texture they are mapped to, doesn't change.

      6 - This is simply me showing the texture in question. In reality, I had to open up the .dds fileinside GIMP to see it, as to my experience, NifSkope doesn't have simple feature to see textures for Guild 2, the game itself assigning the texture during runtime. I added it here for a visual aid, you should find a program to view .dds files with separately. GIMP and I believe Paint.net are both excellent free ways to do this, though both might need extra plugins.

      As a bit of a viewing aid, I will now also insert a picture of the in-game female thief model.
    • 7 - For many, maybe even all models, you'll notice that vertexes and by extension triangles are laid right on top of eachother, though generally, only for triangles that are mirror images of each other. These vertexes, pointed out by the arrow, are actually 2 sets of nearly identical triangles, namely the left and right side of the bottom of the thief character's shirt. (The white cloth that hangs out under her corset, almost like a skirt). The front and the back of this area are the rectangle-ish shape below the one pointed out by the arrow, and the one below the bright gray area. All four of these, are mapped to roughly the same part of the texture, and as such, the place where they touch is practically invisible.

      8 - What you see here, is that as I said, vertexes in that area, are actually 2 identical sets of vertexes, from either side of the bottom of the shirt, left and right. If you want to move one, but not the other, the most straightforward way, is to click one of the vertexes, "Select Connected" via a right click option, and then use either click and drag, or Alt+S to move them apart. As you can see, while these vertexes are right on top of each other in the UV map, they aren't actually "connected", since they are on opposite sides of the model.
      If you want to move them both, which in most cases is likely the way to go, you can simply box select the entire shape and then Alt+S or click and drag them together.
      Finally, since sometimes these duplicates are going to be in crowded places like the bright gray square, if you want to move them together, you can also Click->Select Connected->Alt+S move them to a precise spot by translating their coordinates by say 6 to the right in the X axis, then repeat it for the other set of triangles, after which they will be once again right on top of each other, except by 3 texture widths to the right.



      So then, now that you know all this, what else is there?
      If you, for example, want to add more variety to a texture, you could do one of the following:
      a) Select every vertex group outside of the bright gray area, and use Alt+S on them with multiples of 2, until you move them inside of the bright gray area. This will show you what parts of the texture are actually not used right now, if any. At this point, you can use a .dds editor like GIMP to fill in that part of the texture with whatever you want, and move/scale/rotate the triangles until they fit into that part of the image.
      In the Female Thief's example, you could for example give the bottom of the shirt a new texture to spice it up, and put that texture in the bottom left corner, as no other part of the model uses the bottom left corner, and no part of the skirt is much bigger than that blank area there.
      b) If you don't mind the rest of the model's textures losing a bit of resolution in-game, you could move everything into the bright gray area as before, and then select them all and scale them horizontally or vertically by some amount.
      If for example, you scale them horizontally, along the X axis by 0.8, that will mean that they now are only 80% as thick as they were before. At this point, you can Alt+S (or if you're brave, click and draw) them to one side of the bright gray square.
      Now you have 20% of the entire texture unused. In GIMP or your choice of software, scale the entire texture the same way, shrinking it to 80% horizontally, and moving it to the same side you moved the vertexes inside the bright gray square.
      You can now pain whatever new texture you want into that 20%, and then move the vertex group you wanted to use that new texture into that part of the image.


      There's also the issue of figuring out what part of the body some of these vertex groups represent. While some are going to be obvious, such as textures for a medalion making it obvious it's textures for the character's neck in this case, or hand shaped vertex groups being for hands, other times it may be hard to figure out which triangles appear where on the body.
      A quick and dirty way, is to simply put different colored X-es on the actual .dds file in various places, and then seeing in-game which color X appears where.



      Naturally, this is a bit hacky, and obviously not the best way to do it. If you figure out a way to reliably get the same or better results in Blender, or some other piece of software, I'm sure people would be grateful to know!
      But for now, this is just a dirty deed done dirt cheap kind of way to do it.


      Also, one last thing to remember: While I suggested moving everything into the bright gray area, it's tidier to then move the vertex groups back out around it using the Alt+S multiples of 2 method. It might make your life easier later on, while trying to move around the vertexes again, or for someone else who might want to use your .nif files.