Last month's Custom Content Challenge had me drawing a blank so I punted.
Twice, heh heh. A few weeks after I'd created my submissions, I had some free time to try again, hopefully to make something a little more like what was actually requested. About the same time I came across a thread about necklaces and in there TheSpiritedLass was talking about retexturing some of Estelindis' beautiful necklace neck pieces. JediJax suggested it would be cool to get some Forgotten Realms diety symbols on them and it sounded like a great idea to me. With all
these beautiful images to choose from, it was a slam dunk and I could finally make something which fit the bill for the challenge!
Except...texturing body parts doesn't work like that. Each body part has one texture, which is a PLT which has the same name as the model. If you add geometry to the model and give it a different texture, in-game it will override your choice and use the PLT instead.
'>
So what looks like this in G/Max:Winds up looking like this, in-game:And that is a big sloshing bucket of No Fun. In fact, if you want to add a bit of geometry like that not only do you have to edit the PLT for the body part and add the texture, but you have to PLT-ize the texture. Looking at some of those Forgotten Realms holy symbols I link to at the top of this message, it probably would have taken
hours to convert just one of those images to PLT and squeeze it into the bodypart's PLT, shifting around the UVW's to make space for it. And even then, the color range available with PLT is so much more limited than 24-bit color that it probably wasn't even going to be worth my time to make a proof of concept piece.
So, what had started out as a "slam dunk" idea quickly took a high-dive into the crapper as "impossible". Ugh.
However, as luck would have it, I have been spending a lot of time exploring a set of undocumented TXI commands which I culled from careful study of the
strings contained in NWMain.exe and trying my best to find out what they actually did. Surrounded by a crackling aura of TXI magic and knowledge of the Aurora engine, I was able to come up with a solution which is very simple and which allows you to add additional geometry to your body part model and use TGA or DDS textures for it.
So you can have both PLT and TGA/DDS textures present on the same model (though obviously on different meshes) at the same time.Here is how the solution works:If you've watched my animated texture tutorial on YouTube you'll recall that we look at both virtual emitter planes and regular geometry as a target for our animated textures. And that during the tutorial, virtual emitter planes come out ahead until the last installment where we see how deeply the TXI system hooks into the NWN graphics subsystem and how it can override
any texture if we slip in a TXI file of the same name.
Even though we see in the above pictures that NWN overrides our choice of textures and uses the PLT texture with the same name as the body part, it turns out that deep-down NWN
remembers the name of the texture we wanted it to use. If we supply a TXI with the same name was the texture we applied in G/Max, NWN will read it in and execute any commands in it. This is our "in". And by putting the following command into a TXI file, we can make NWN override itself and use the texture
we specify:
bumpreplacementtexture (name of texture, TGA or DDS without the extension)
In other words, let's say we want to display texture
B on our mesh. We apply texture
A to our mesh in G/Max and create a TXI file with the same name as texture
A which points to texture
B. NWN loads up the body part model, paints the regular bodypart with the PLT, comes to our mesh, sees texture
A's name, looks up the TXI for texture
A and is redirected to use texture
B. Clever, eh?
So here's my model in G/Max with the sacrificial texture applied:And with the TXI pointing to the real texture, this is what you get in-game:This is the workflow I use:1. In G/Max with my bodypart loaded, I introduce whatever new geometry I want.
2. I apply the texture I'm going to want displayed in-game to that new geometry and make sure the UVW mapping on the mesh is to my liking.
3. I then apply a "sacrificial" texture to the same mesh, overwriting the texture I want to be displayed in-game. I use a very small (32 x 32) TGA texture which only takes up about 5k.
The sacrificial texture is so-called because it is never displayed, only used to trigger the TXI-lookup functionality. Then I export the model.
4. I make a TXI with the same name as the sacrificial texture and use the
bumpreplacementtexture command followed by the name of the texture I want to display in-game.
That's it!
And what about that necklace idea that spawned all this? In Max, I enlarged Estelindis' necklaces, sliced out the amulet face into a separate mesh to which I applied the above system and presto:
Metal rim, cording, skin, etc. on her necks are still PLT but the actual medallion face is TGA and so I get the full benefit of 24-bit color without the hassles of the past.
But why stop there?
What if, for instance, the texture I want displayed in-game also came with a TXI of its own?
Would NWN load that TXI and act on it as well?
Yep. You can keep chaining textures out via TXI as far as you need. Which indicates that all other TXI functionality can be used with this system, including proceduretype cycle.
Which means you can have animated textures on your bodyparts as well!Like this:There are other ways, like VFX, to get models onto a player. This system works best for jewelry like Estelindis' necklaces and how much more useful it is than say, VFX, depends on what you want to do.
These are some Fallout 3 helmets straight-up converted to NWN. They took about 3-4 minutes each (max) for the raw modeling changes. Though they could have just as easily been a resized Gnoll or Fire Giant helm. Or a helmet from Dragon Age or Oblivion. Or BioShock 2. If you can load up a model into G/Max, and it has a diffuse texture, then there's nothing really stopping you. And that brings the
FacePunch candy store one step closer to NWN.
OldTimeRadio
Modifié par OldTimeRadio, 13 mai 2011 - 07:48 .