Author Topic: Problem transforming .TGA into .PLT  (Read 1210 times)

Legacy_Michael DarkAngel

  • Hero Member
  • *****
  • Posts: 627
  • Karma: +0/-0
Problem transforming .TGA into .PLT
« Reply #15 on: June 26, 2014, 11:52:26 pm »


               

Bannor is probably right as to smoothing group limit.  What that limit is, I don't know.  I do know that I just created a model that uses 9 smoothing groups and the ascii representation of that looks like this


 


    34 31 38    1  51 48 55  1
    36 39 38    1  53 56 55  1
    38 39 34    1  55 56 51  1
    40  3  6    2  57 19 23  1
     6  2 40    4  23  2 57  1
     2  1 40    8   2  1 57  1
    40  1  0   16  57  1  0  1
     0  8 40   32   0 25 57  1
    40  8  9   64  57 25 26  1
     9  4 40  128  26 21 57  1
    40  4  3  256  57 21 19  1
    35 34 36    1  52 51 53  1
    36 34 39    1  53 51 56  1

 


The fourth column represents the smoothing group.  Until I perform some more extensive testing, it appears as if my 9 smoothing groups will work.


 


icon_zdevil.gif


 MDA


               
               

               
            

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0
Problem transforming .TGA into .PLT
« Reply #16 on: June 26, 2014, 11:56:25 pm »


               

<blink, blink...>


 


"An error occurred. You have reached your quota of positive votes for the day."


 


Seriously? 


 


Wow.


 


Guess I'm supposed to get all negative now...


 


<...blink>



               
               

               
            

Legacy_Michael DarkAngel

  • Hero Member
  • *****
  • Posts: 627
  • Karma: +0/-0
Problem transforming .TGA into .PLT
« Reply #17 on: June 27, 2014, 12:04:53 am »


               


<blink, blink...>


 


"An error occurred. You have reached your quota of positive votes for the day."


 




 


That's a first.


 


Ran a test.


 


Compiled my model on export and then re-imported.  My model now has only 7 smoothing groups, not the 9 I exported it with.  The two faces that were smoothing group 8 and 9 were both given smoothing group 1.


 


Guess that answers our limit question.  At least as far as exporting goes.  What the game engine renders...  That requires more testing for a later time.


 


Right now, it's dinner time.


 


icon_zdevil.gif


 MDA



               
               

               
            

Legacy_MerricksDad

  • Hero Member
  • *****
  • Posts: 2105
  • Karma: +0/-0
Problem transforming .TGA into .PLT
« Reply #18 on: June 27, 2014, 01:19:50 am »


               

I just exported this weird little crystal shape as an appearance and ran it in a torch lit area so I could make certain all 10 smoothing groups were utilized, and they were.


 


To test it out, just copy any non-pc creature appearance type and change its model name to md_testfaces. Unzip md_testfaces.7z to your override folder. Hop in game, debug mode 1, SetAppearance to your new appearance index. Stand up against any light emitter and spin in place and you can see easily all 10 smoothing groups are utilized.


 


https://www.dropbox....md_testfaces.7z


 


To determine if the limit is 16, or as I suspect, a full 32 ( I won't bother testing further than that ), here is an updated md_testfaces.mdl with 18 groups. Due to the height of the torches in my test module (not included), it becomes harder to tell if the newly extruded and manually smoothed faces are rendered separately, but with some positioning of the camera, it does become clear that the limit is somewhere above 16. There is no rounding of any edges on the shape and clear seam lines can be seen at certain camera angles and certain distances from the light source.


 


I'm going with full 32 smoothing groups, which would make use of an entire unsigned 32 bit integer worth of smoothing groups. Due to zero being code for no smoothing group, this actually may be capped at 31 specified groups, and 0 left open to not smooth.


 


https://www.dropbox...._testfaces18.7z


 


But the real interesting question is: what happens if you have 18 specified groups, and 20 polys (40 faces) without specified smoothing (exported as 0). What is the cap on the engine's groups? This freakish file shows just how interesting the NWN engine still can be. All 18 specified groups and 20 dynamically calculated polygons are rendered in separate groups, making at least 38 groups available at run time.


 


https://www.dropbox....aces18plus20.7z



               
               

               
            

Legacy_Bannor Bloodfist

  • Hero Member
  • *****
  • Posts: 1578
  • Karma: +0/-0
Problem transforming .TGA into .PLT
« Reply #19 on: June 27, 2014, 03:14:24 am »


               

what toolset are you using to export the mdls you used for testing?



               
               

               
            

Legacy_OldMansBeard

  • Full Member
  • ***
  • Posts: 245
  • Karma: +0/-0
Problem transforming .TGA into .PLT
« Reply #20 on: June 27, 2014, 07:51:02 am »


               

Theoretically, you can have up to 32 smoothing groups per mesh in ascii models. As MDA has posted, they are represented as bit flags in the 4th field of the faces data and anything that reads those numbers as unsigned 32-bit integers will understand them. A face can be a member of any, all or none of the groups.


 


The game engine doesn't use smoothing groups at all. Smoothing groups don't exist in binary models. They use vertex normals. The compilers use the smoothing groups to compute the vertex normals, then throw them away. The decompilers reconstruct them but there's no unique way of doing that so if you compile and then decompile, the resulting numbers may look different from the original ascii model. Doesn't matter.


 


The AutoSmooth and TurboSmooth functions in GMax/3dsMax correspond well to the way the NWN engine works.


 


Have fun.


 


OMB



               
               

               
            

Legacy_Wallack

  • Full Member
  • ***
  • Posts: 221
  • Karma: +0/-0
Problem transforming .TGA into .PLT
« Reply #21 on: June 27, 2014, 08:31:03 am »


               

Will focus this afternoon in creating more medieval helmets.


 


Anyway I tried to create a robe from one of the models of the same game and I ran into the problem that I don't know how to animate it. I just imported a .mdl and replaced its robe with mine:


 


lNYGgbQ.png


 


T-shape is an issue but the animation is a bigger one. Anyways this is too big for me, at least for now.


 


If anyone is feeling in the mood to try, here is the brienne's robe: http://hieloyfuego.com/robe.rar (I have to try ... xD)


 


Thanks everyone!



               
               

               
            

Legacy_Estelindis

  • Hero Member
  • *****
  • Posts: 935
  • Karma: +0/-0
Problem transforming .TGA into .PLT
« Reply #22 on: June 27, 2014, 10:06:32 am »


               

Oh my God, Brienne's armour!   '<3' '<3' '<3'  Amazing stuff.   '<img'>  Which game is this model from?  The Game of Thrones RPG?  I got that in one of the Humble Bundles but haven't played it yet...


 


Anyway, near as I can tell, the basic way to animate a robe involves a skeleton, i.e. a combination of linked dummy nodes (for body parts that you don't want hidden by the robe) and very basic, shadow-only meshes (for parts that you do want hidden): one for every part of the body whose movement you want to affect part of the armour.  It's often easiest to load an existing robe into Max and just delete the actual, properly-textured robe part; you should be left with the supportive skeleton (the "bones").  You then want to apply a skin modifier to your robe, add the bones to that, and then paint vertex weights for each bone.  The CC guide goes into it at better length!  http://web.archive.o...ad.php?id=19587  Anyway, I'm gonna have a try at that Brienne robe.  


 


By the way, I am still working on the "Skyrim" armour (it wasn't first in Skyrim or something?).  I am making it so that you can have a variety of chest models visible just sort poking out at the neck and shoulders.  If this turns out to be too much hassle, I'll revert to the previous version, but we'll see.



               
               

               
            

Legacy_Wallack

  • Full Member
  • ***
  • Posts: 221
  • Karma: +0/-0
Problem transforming .TGA into .PLT
« Reply #23 on: June 27, 2014, 10:13:22 am »


               

Hi!


 


Thanks for the answer.


 


The model comes from Mount and Blade Warband with a lot of different GoT armors. I'm creating a PW based on song of ice and fire and those would be PERFECT for me.


 


I will try follow that tutorial. The skyrim one, yes, is skyrim '<img'> I was able to convert it to a robe as well, because is fully animated as is a creature, but with this one I have a lot of problems, but will try '<img'> Thanks for the tutorial!


 


The skyrim one ... just used the robe just exactly like you, one piece but without arms or legs. Good thing about those models, they are in a full piece (model and texture). Bad thing ... I don't know how to turn the arms as they are one fully piece. But we are close thanks to all of you guys '<img'>


 


Don't really know what you mean by variety of chest models, are you creating it as a chest model instead of a robe?


 


God, so many things I want to do ...


 


EDIT: by the way I really love this tutorial but without imgs is pretty hard: http://ccg.animecafe...php?title=Robes



               
               

               
            

Legacy_Estelindis

  • Hero Member
  • *****
  • Posts: 935
  • Karma: +0/-0
Problem transforming .TGA into .PLT
« Reply #24 on: June 27, 2014, 10:38:35 am »


               

Yes: I agree that the tutorial would be better with images.  '<img'>  Anyway, parts of a mesh can be moved and rotated by selecting them at the vertex or face level of the editable mesh.  I am currently trying to move the arms down.


 


Thanks for the info about the games!



               
               

               
            

Legacy_Wallack

  • Full Member
  • ***
  • Posts: 221
  • Karma: +0/-0
Problem transforming .TGA into .PLT
« Reply #25 on: June 27, 2014, 11:05:55 am »


               

No, thank you for helping '<img'>


 


I ported 2 more helments:


 


This one still needs work with the .PLT, but this will be done this afternoon


 


Hoo5QwY.png


 


This one needs to be bigger:


 


4SrJ7gk.png


 


Just want to try this afternoon to follow the tutorial blindly '<img'>



               
               

               
            

Legacy_OldMansBeard

  • Full Member
  • ***
  • Posts: 245
  • Karma: +0/-0
Problem transforming .TGA into .PLT
« Reply #26 on: June 27, 2014, 11:38:10 am »


               

I looked at converting Skyrim robes into NWN a while back. Didn't really succeed but I can offer some thoughts. The basic problem to be addressed is that the skeletons are different. There are a number of possible approaches:


  1. Discard the Skyrim skeleton and the vertex weights, add a NWN skeleton and paint the new weights manually

  2.    
  3. Ditto, but compute the new weights automatically from the old ones in some principled way

  4.    
  5. Keep the skeleton and the weights and construct new animation supermodels for the skyrim skeleton in NWN

Approach (1) is the only feasible option without writing special software. I tried adapting CM3 to do (2) but wasn't satisfied with the results, particularly for robes with knee-length kilts or skirts for which there are no bones in NWN. Approach (3) would be the best in the long-term because it would only need to be done once and then the resulting supermodels could be used for any number of robes. I had some success with adding code for approach (3) to CM3 but didn't develop it far enough to be widely useful as a package. I can say that software to generate supermodels for an enhanced skeleton from the vanilla supermodels, by adding bones and interpolating keys for them mathematically, is definitely possible but it's not simple and when I tried, after a few months my brain got tired and I shelved it.


               
               

               
            

Legacy_MerricksDad

  • Hero Member
  • *****
  • Posts: 2105
  • Karma: +0/-0
Problem transforming .TGA into .PLT
« Reply #27 on: June 27, 2014, 11:59:02 am »


               


what toolset are you using to export the mdls you used for testing?




NwMax 0.8 b60


 


As you can see I also do not compile these models.


               
               

               
            

Legacy_Wallack

  • Full Member
  • ***
  • Posts: 221
  • Karma: +0/-0
Problem transforming .TGA into .PLT
« Reply #28 on: June 27, 2014, 12:09:18 pm »


               

After I finish all the .mdls for my haks, should I compile them?



               
               

               
            

Legacy_MerricksDad

  • Hero Member
  • *****
  • Posts: 2105
  • Karma: +0/-0
Problem transforming .TGA into .PLT
« Reply #29 on: June 27, 2014, 12:15:11 pm »


               


After I finish all the .mdls for my haks, should I compile them?




 Depends on your personal needs. Heavy models benefit from initial load time speed increase. I generally don't, so that I can easier debug stuff later without having to first decompile. It also lets me process stuff with a text editor by entire directory when they are uncompiled.