Jump to content

Recommended Posts

Posted (edited)

Hi everyone on this great forum! 😊

I decided to start my own little thread, even though I’m still relatively new here. I’ll be posting my work-in-progress, notes on how things are done - mainly for myself, so I can come back and refresh my memory later. If it ends up being useful to someone else as well, I’ll be happy of course. I’m sure everything I’m writing about has already been discussed countless times on this forum and is familiar to everyone. But I’m still a newcomer!

My already released mods:

While working on the Canderous head I made a bit of progress learning Blender. I only knew it at a very basic level before, because I’m a 2D artist, not a 3D one. I still don’t really know what proper topology should look like, how to paint weights correctly, how to build textures with nodes, and so on. I’ll be learning all of that gradually.

For this particular head I took a high poly mesh from this mod - big thanks to the author! Of course I heavily edited it: the geometry, the UV unwrap, and the texture. I also learned a few useful texture painting tricks. Geometry-wise the hardest parts are always the eyes and the lips, because the animation has to deform them properly, and what looks fine in Blender often ends up looking completely different in the game.

Spoiler

01.png.9bd2aa238a3a9c0d32557a4080230a69.png

Something I’d like to note here for myself - how to get rid of grey spots on the model after exporting from Blender to mdl/mdx:

1. The most important step - clear Custom Split Normals Data:

  • Select the head mesh in Object Mode.
  • Go to the Object Data Properties tab.
  • Expand the Geometry Data panel.
  • If the “Clear Custom Split Normals Data” button is active, click it. This removes the old broken data and forces Blender to recalculate the normals.
Spoiler

02.PNG.a6c3734d8790440a88a4cc634e5f2f01.PNG

Also helpful:

2. Apply smoothing — Right-click the model → Shade Smooth.

3. Apply transforms — Use with caution and only when needed! Things can shift in unexpected ways. In Object Mode select the head and press Ctrl + A → Apply All Transforms.

Spoiler

03.png.0b645d3c86c6d6a0f19b27683e1f48fb.png

____________________________________________

P.S. English is not my native language, so I apologise in advance if anything is phrased awkwardly.

 

____________________________________________

Then I decided to retexture the high-poly Bastila body from the TCS mod. The thing is, we started playing through BOSSR on stream, and there Shadow uses Bastila’s body. And we have this Bastila mod installed. So I made her this outfit. I didn’t touch the model or the UV unwrap, only the texture. I painted the alpha channel in the places that should be more shiny. Since I don’t know how the original model author would feel about this little “side project” of mine, of course I won’t be releasing this texture anywhere — it’s purely for personal use.

Spoiler

04.png.eb6085e9eb04af146fcc6d2cb169e2be.png

After that I moved on to her head. I wanted both the lekku and the face itself to have more polygons. So I simply applied a Subdivide, then worked on the mesh — editing vertices, sculpting, and so on. Then I started texturing, and at that point I really wanted to add a bump map so the lekku would look bumpy the way vanilla Twi’leks do (even if the vanilla ones are very low quality). I dove deep into the problem — I remember spending entire weekends glued to this forum reading everything people wrote about adding bump.

Nothing was working for me.

I tried every piece of advice, converted the poor bump map to TPC every which way, opened the model files in ASCII and searched for tangent vectors… I even started recalling university calculus about quaternions and how I used to redefine matrix multiplication in C++ practicals…🤣

It turned out the problem was completely different. The BOSSR mod authors used the "Twilek05" head model, but in heads.2da they assigned it the texture name "matilda_headd". Meanwhile the model itself is linked to the texture "Twilek05". And even though the engine can pull the main (diffuse) texture information from a texture that isn’t the one specified in the model, it cannot pull bump map information (and apparently txi info as well) from a texture with a different name! I don’t know why it works this way — maybe some internal script.

Anyway, once I renamed the main texture to "Twilek05.tga", the bump map to "Twilek05b.tpc", wrote this in the "Twilek05.txi":

bumpyshinytexture CM_SpecMap
bumpmaptexture Twilek_F05b
and also put "Twilek05" as the texture in heads.2da — miracle of miracles, the game finally saw the bump map!
Spoiler

Untitled-2_0000_Layer-6.png.bed4efe913926b2ed3149d4c0c272975.png

Spoiler

Untitled-2_0000_Layer-7.png.dee23616ee11107597b90c604e4812cc.png

Spoiler

Untitled-2_0001_Layer-4.png.66f6f3eace1e9ffd10edabc84d0d7032.png

Spoiler

Untitled-2_0003_Layer-1.png.0778abcfb93bc394b788d89d1622d499.png

Yes, it didn’t turn out perfect — the bumps are too fine and therefore look a bit like shimmering. I probably won’t fix it, because we had to abandon that mod playthrough — it conflicted with other mods.

But I’ll write down the key points needed to add bump (even though all of this is already on the forum — huge thanks to DarthParametric and everyone else who shared advice and tutorials):

  1. Before exporting, you must enable the “Tangent Space” checkbox in the KotOR Model Node plugin options for all the meshes that need it (in my case “hair” and “head”). 
    Spoiler

    05.PNG.eb4498ce754c7ab2bd08266887aee85e.PNG

     

  2. To verify — open the model in MDLEdit, save it as ASCII, open it in Notepad++ and search for the word “tangentspace”. On the relevant nodes it should say tangentspace 1, not 0. If it somehow still shows 0 even though the checkbox was enabled on export from Blender, change it to 1, save, open that ASCII file again in MDLEdit (it might complain that it can’t recalculate the vectors — hopefully that’s not a problem), and then save it back to binary mdl/mdx. 
    Spoiler

    07.PNG.062a9744d4d5038c132c2454b74ce453.PNG

  3. You can also just tick the corresponding checkbox in MDLEdit itself and re-save — but keep in mind that the bump will then be applied to every mesh in the model that uses that texture, not only the ones you might have wanted. 
    Spoiler

    07.png.e20655f6430a84e9c57726ba2ff8094f.png

  4. Preparing the .txi. It must have the exact same name as the main texture, and the main texture must be the one that is actually linked to the model.
    Inside the .txi you need:
bumpyshinytexture (your Cubemap)
bumpmaptexture (your bump map name)

In theory bump should work without the shiny part (only the line "bumpmaptexture " in txi), but for me it never did — because in that case the engine treated the alpha channel of the main texture as transparency. Meaning:

  • if you darken the alpha to make the bump stronger → the object becomes transparent
  • if you leave it white → no bump is visible.
    Maybe I’m doing something wrong?
  1. Preparing the main texture. It must be named exactly as specified in the model (you can check that here).
    Spoiler

    06.png.05d5f0205af3963774ebe071146aa782.png

    It needs an alpha channel that controls both the shininess (via the Cubemap) and the strength of the bump. The darker the alpha, the stronger both effects. Yes, both at once — there’s no other way.
  2. Preparing the bump map. Save the main texture as an image and throw it into this website (again, thanks for the link — found it on the forum). You can increase Strength if the texture isn’t very contrasty, and add a bit of blur (slider to the negative side). Download the result and save the texture as TGA with a pure white alpha channel.
    Then use tga2tpc with these settings.
    Spoiler

    08.png.2a77819362747347b132ab3ca01b3489.png

    You can also add extra lines or strengthen the bump with the bumpmapscaling value, as DarthParametric wrote here:
    https://deadlystream.com/topic/9353-bump-mapping-tutorial-request-for-novices/#findComment-87017
  3. Final contents for the override folder: the model (mdl + mdx), the main texture (tga), the .txi with the parameters, and the bump map (tpc).

Phew. The last thing I learned on this head was adding new geometry — I wanted to model headphones and a stone on her forehead. Important points here: convert everything to triangles and weight-paint it to the head.
To check — switch to Weight Paint mode and make sure it’s painted red. If you need a piece not to move with the head, weight-paint it to the neck instead (a different vertex group).

Spoiler

10.PNG.dee32d6921c31c0251d8f19356478e34.PNG11.PNG.d785f6c6b4909db8d7e9c010814cab81.PNG


If you don’t weight anything at all, those pieces of the model simply won’t appear in the game.

🙃🙃

I’ll say it again: I’m by no means an expert on KOTOR modding, so I apologize if I write or do anything incorrectly! And, of course, I’d be grateful for any advice, comments, or corrections.

 

 

Edited by Narve
  • Like 2
  • Thanks 1
Posted

The next big project was a retexture of the Ebon Hawk’s exterior hull. Looking at the vanilla one was genuinely painful, and the existing retextures didn’t really improve the situation.

I really wanted to bring its appearance closer to this:
https://www.artstation.com/artwork/GXwXyB

Because in my game I’ve replaced the original cutscenes with several very beautiful ones that use this model. And the model itself is just awesome!

But I immediately ran into the problem that the UV layout was completely unsuitable - a lot of overlapping, and many areas of the texture were shared between completely different parts.

And… I went down the wrong path. I found the "v_ehawk" model in the game files and started fixing the UV unwrap. I did everything properly: separated the overlaps, made the areas that are visible up close when you walk around the ship larger. Texture in 4K. I was even about to start editing vertices and adding polygons. But then I discovered that none of my changes were visible in the game at all. I spent several days scratching my head, thinking I was exporting the model incorrectly somehow.

Of course it turned out to be much more mundane - the model I was editing had nothing to do with the ones that appear on the landing pads on different planets. I have no idea where the game actually uses it - probably in some cutscenes? What we see on the landing pads and in the docks is part of the area, not a separate model. And if I want to edit it, that means editing the entire area - which automatically means incompatibility with any other mod that also edits that area.

So I sulked a bit, complained a bit, and decided for now to limit myself to pure texture work.

But then another “brilliant” idea struck me - we don’t look for easy ways, right? Realising that adding polygons wasn’t going to happen, I wanted to add a normal map, inspired by my previous experience with the Twi’lek head. I thought, at least it won’t be a flat picture stretched over polygons, there will be some relief. I also spent a long time on the texture itself, adjusting it so that the overlapping UV pieces still looked decent… It was challenging to strike a balance between the desire to match the reference and the limitations of the existing UV layout. I hope the result turned out well. I wanted to make 8K textures, but the engine was clearly starting to struggle when loading areas, so I settled on 6K.

But with the bump I was in for a fiasco.

Actually, I could have suspected something when looking at the original game files - there was no bump specified in the .txi files at all, even though bump maps were provided for every texture. Why do they exist? I still don’t know the answer to that question.

Interestingly, the engine did react to the presence or absence of the bump map - the shaders changed and the image looked different. But the actual content of the bump map didn’t affect anything. For the experiment I tried both a completely flat solid “blue” bump map and an extremely contrasty one amplified 15× during conversion to TPC. There was zero difference.

After quite a long series of experiments with different bump settings, .txi options, and the alpha channel of the main texture, I finally found the answer — and I’m sure it has been discussed somewhere on this forum, I just never came across it. On area objects the lighting is almost completely baked into the lightmap. Dynamic bump (the kind that reacts to real-time light direction) barely shows up at all. Especially if the lightmapped flag is enabled on the mesh.

I looked into the node of the long-suffering ship, and sure enough, there it was:

Spoiler
node trimesh EbonhawkBody
  parent M13aa_01a
  position 22.17 -0.0975 11.3775
  orientation 1.0 0.0 0.0 0.0
  alpha 1.0
  scale 1.0
  selfillumcolor 0.0 0.0 0.0
  diffuse 1.0 1.0 1.0
  ambient 1.0 1.0 1.0
  transparencyhint 0
  animateuv 0
  uvdirectionx 0.0
  uvdirectiony 0.0
  uvjitter 0.0
  uvjitterspeed 0.0
  lightmapped 1
  rotatetexture 0
  m_bIsBackgroundGeometry 0
  shadow 0
  beaming 0
  render 1
  dirt_enabled 0
  dirt_texture 1
  dirt_worldspace 1
  hologram_donotdraw 0
  tangentspace 1
  inv_count 353
  bitmap LDA_EHawk01
  bitmap2 M13aa_01a_lm0
...

 

As an experiment I turned off the lightmapped flag. And to my astonished eyes this is what appeared (the bump map at that moment was the extreme one) — view with caution! 🤣

Spoiler

09.png.fc04090fea596ee9ee146ed44dbcab68.png

Of course it’s pure horror, some kind of Dark Side of the Force visions. 😁

So I don’t know whether to include these normal maps in the mod release for the textures where the ship is part of the area. Are they needed? Probably not.

For the model that isn’t part of an area - apparently the one used in some cutscenes - I will of course add the bump. Might be useful.

A few nice pictures:

01.png.6a290e7916111f221a1dcafd6b21fcd9.png

02.PNG.10ac5215c5ba0605a4d9f6e433dbbdf3.PNG

03.png.a23405f74520c06ece40567ad3a5c244.png

04.png.41ec0b23a59ce235b591bcf28301f15d.png

05.png.438ec361b0fa23170b51b0b686b0a29a.png

06.png.93f3f560dfdc7516c16c9247ec893dd5.png

07.png.19c70c69a44fda203447d4752a139d81.png

08.png.04c266c7303d7ead7afc4cfa846d7090.png

All that’s left is to add the texture for the upper hull (roof) model that is used in the mini-game where you shoot down fighters, and touch up small details here and there. And then the mod can be released.

Posted

Nice work, yeah, might be worth testing if Synchro's patch for Kotor Patch Manager fixes this in k1. Some of the shaders are long broken, and it's possible that on period correct hardware this actually worked differently.

 

If you port to K2, to work in the Aspyr version you'll have to have my bump map fix, otherwise bump and normal maps simply don't work.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Guidelines.