Custom head models / bodypart models and texture-rules: Questions and answers

While I tried to create my own custom head, i stumbled upon a few question marks from my side regarding head models. Now I couldn’t find any info on this or a tutorial, so here is, what I found / are my questions:

I have a head made out of 2 parts: face and hair. Both show up, so heads don’t have to be one mesh. BUT can these head parts make use of 2 different textures? I only get ONE to show up and only if it has got the same name as the base.
I want face-mesh->face.tga and hair-mesh->hair.tga…
→ (Even though I managed a way:) Is that possible?

Well, besides this I kept on testing. So I created a single TGA by joining the 2 squared textures to one with 1024x2048. I named it like the head model and now it works.

But with this came my next observation: Transparency on head-model-textures: This custom texture has transparency (within the hair regions).Whereas the transparency shows in the toolset, it does NOT show in game! There it’s kind of milky looking.
To rule out my custom model/texture, I now used a vanilla head pmh0_head001.mdl and it’s texture. I ported the PLT into a TGA and renamed all to pmh0_head040 (a free “head-slot”), so I don’t get a PLT messing in. It shows up nicely in the TS and IG!
Now I testwise added an ALPHA to the head texture (top = solid, bottom = see through), and guess what: Same thing:
Toolset:
transparency_on_head-mdls_TS

And that model IG:
transparency_on_head-mdls_IG

→ Tested in EE .34.1

Question: Is it possible to make transparency on head-model-textures work IG?

If anybody knows a link to a good head tutorial, which covers my findings/issues/questions, that would be nice, too.

Some chats have occurred on Discord and some more tests were done. So I thought it’s good to do a sum-up (EE .34.1) on this matter:

This is ONLY for models, which are a bodypart (of a part based creature):

  • The model itself can be made up of several (sub-) mesh-objects (eg. one for the face, one for the hair, …). I does NOT have to be one mesh (though probably most of the NWN1 bodyparts are made up of only one mesh)

  • A bodypart can make use only of ONE texture.

  • The texture must have the same name as the model itself (eg. pmh0_head040.mdl → pmh0_head040.plt/.tga/.dds).

  • Normally the textures for bodyparts are PLTs, which enables the user to change the tinting for areas within the texture (hair, skin, …). But you can also assign a TGA/DDS-texture. In this case, the possibility of tinting gets lost - of course.

  • @Dafena wrote, that the engine will always be using the PLT, if it finds one, thus ignoring an additional TGA/DDS texture (with the same naming). I have not tested that, but it makes sense to use a free bodypart-number (one, that is not already in use by the vanilla NWN1-contents) for custom bodyparts, thus bypassing the possibility of an already existing PLT.

  • The (none PLT-) texture must not be a square. In my tests a 512x1024 or 1024x2048 texture does work, too.

None PLT-textures and an ALPHA-channel / transparency:

If you applied eg. a TGA with an ALPHA-channel, you’ll find, that it’s rendered correctly in the toolset, but NOT within the game (see pictures in the first post)!

For my tests, I had some transparent areas within the texture part for the hair for my custom model. The model has two separate meshes / mesh-objects: One for the face and one for the hair. These things I tried, to make the transparency work within the game, BUT IT DID NOT MAKE IT WORK:

→ setting transparencyhint to 1 on the hair-mesh-object

→ make a materialname-entry in the mdl-file (= “materialname pmh0_head040” instead of “bitmap pmh0_head040”) plus a MTR-file, which has the entry “texture0 pmh0_head040”

Merricksdad was able to come up with a custom shader, which actually can force transparency on a bodypart model to work:

https://neverwintervault.org/project/nwn1/other/visual-effect/merricksdads-plt-mixer-shader-ee-only

But in general: Plan your custom bodyparts in a way, that they don’t need transparent areas.

1 Like

I think it is possible though I have never tried on heads but I made it work on clothes. And you dont have to edit the bitmaps (textures).

If you want to see something underneath you need two separate objects on top of each other, the inside one is solid the outside transparent.

If you want it to be a ghost, that transparency setting you mentioned is the only thing you need to do.

You could even just use notepad. Open the model Set the transparencyhint to 1 for the object you want to be transparent. And set the alpha to how transparent you want it to be (must be less than 1)

Works for placeables too.

5 Likes

Just a thought but if you use a TGA/DDS instead of a plt can’t you also use a txi for that texture and isn’t there something to do with transparency/alpha in the acceptable commands for a txi too?

TR

@Stonehammer: What an great addition! Thanks!

@Tarot: I stumbled upon this transparency issue using a TGA and there is no PLT alterntaive for the engine. I don’t know enough about TXI, so maybe sombody else has some smart lines here.
But I think, that the problem lies within the way textures for bodyparts are working - PLT being a collection of several layers all having some transparent parts.

As far as I have tested. plt or tga textures do not really matter (unless you want to control it with alpha channels for torn or gradient effects). Setting the transparency on the object itself (the notepad method) usually does the trick.

1 Like