Freelancer Community Network


Important Message

You are browsing the archived Lancers Reactor forums. You cannot register or login.
The content may be outdated and links may not be functional.


To get the latest in Freelancer news, mods, modding and downloads, go to
The-Starport

Tutorial- How to Skin

Here you can discuss building custom ships, texturing and 3D modeling in Freelancer

Post Sat Jun 04, 2005 1:20 pm

Tutorial- How to Skin

I've been answering a lot of questions about "how do you do X, Y or Z" lately, and I've decided that the time is right to write this tutorial about skinning techniques.

This tutorial will hopefully get stickied, as it more-or-less replaces the previous "how-to" guide, Kasdian's Overhaul Guide and the sections of Drizzt's Tutorial that covered skinning to some extent. The previous guides were OK, but they really didn't cover skinning very well, nor the specific techniques used, and I'd like to expand our knowledge and teach a more streamlined method.

This tutorial will NOT teach you how become a Photoshop or 3D modeling whiz. Such skills are assumed. Unless you are unusually talented, your first skins/ships will stink on ice- but that's OK. This tutorial will help you get closer to your goals. If you want to know more about how to do things in Photoshop, I suggest reading jsncaliff's great tutorial, which can be found here.

To start this tutorial, download this file. Do not skip this part- the file's large, and it may take awhile to download, but it contains very valuable information! looking at the files I used to make the tutorial will greatly enhance its value to you, trust me. This is a zip archive which contains the following things:

1. The original model, just after export from Rhino3D, in the OBJ format.
2. The original model, after using UVMapper Classic to create the uv-map.
3. The final version of the model prior to export, in MS3D format.
4. PSD (Photoshop) and DDS DTX1 versions of the final skin.
5. The final CMP file with embedded MAT.

When you read this tutorial, please open each of the files I'm going to be talking about, and look at them carefully. Almost any modeling application can import OBJ files, but I'm assuming that you're looking at everything in Milkshape3D. I also am assuming that you have UTF Edit (you can get it here, along with everything else that's currently available), the CMP and MAT Export plugins for MS3D... and have installed them per their documentation.

Edited by - Argh on 11/6/2005 4:11:12 AM

Post Sat Jun 04, 2005 1:29 pm

Preparing the Model to be Skinned.

***************************************************************************************
***************************************************************************************
***************************************************************************************

It's amazing, really, how few modelers know how to do this, and are still skinning their creations the hard way. If you're brand-new to skinning... learn this way, and you'll be ahead of the game.

Very simply, before we export our model into whatever format we're going to skin it in (for most of us, that's OBJ)... break your model up into the areas that will be skinned, both by the part names and by the projection types.

What are part names, you say? Very simply, in any 3D application worth using, users can assign names to the parts of their models. I know that this can be done with 3DS, Maya, Lightwave, Rhino3D, GMAX, Milkshape3D, etc... so, basically... any modeler worth using has this feature (and most of the worthless ones, too- it's an extremely important and basic feature). So... find out how to label parts, and start getting into the habit of assigning them totally unique names as you build your model.

The "totally unique names" issue seems to be the first thing that trips up people with game modeling over and over again. Very simply put... video games aren't very smart about names. If two things have the same name, then they get "confused", and Bad Things will happen. So... it doesn't matter if you're working on a Half-Life 2 mod or Freelancer... learning to name things as you go... and give them totally unique names... is a very important thing to get into the habit of doing.

Here are some example screenshots, which will show you the Demo Ship's very humble beginnings. The comments below each shot describe what you're seeing here.


This shot shows the model just after being built. As you can see, this is a very un-fancy design, which I really just ripped off from countless bad sci-fi movies from the 1950s. We're going make it kick some @ss later


This second shot shows the early naming process. Note also that I assign colors to each part. This makes it very easy to tell which parts are unique, and it easy to do in most modelers. Note how I'm naming things- partname_modder'sname_shipname. I'm going to be doing that throughout this tutorial, and you should get in the habit. Every single railgun, fin or engine should have a unique name, until you get to the very end of the modeling/export process!


This shot shows the final preparation of the model, before I export it in the OBJ format and lay out my uv-maps, using UVMapper Classic.

Edited by - Argh on 6/4/2005 2:34:49 PM

Post Sat Jun 04, 2005 1:42 pm

Texturing Your Ship

************************************************************************************
************************************************************************************
************************************************************************************

This is a very lengthy process for some people, but it doesn't have to be. I built this ship, took all of the screenshots for this Tutorial, and did the skin in 3 hours- I'm not kidding, it can be done. What it takes... is utter concentration on keeping everything straight, good Photoshop skills, and practice, practice, practice. Your first skins will suck, but you will get better, I promise you. I know I do- every new piece I do gets better and better. Just keep at it.

Once again, the remarks below each shot are describing what's going on here.


The very first step, after exporting the file from your modeling application, is to import it into MS3D. Before doing anything else... try to export the CMP. If MS3D crashes, then something's wrong with your model's geometry, and you need to fix it, or you're doing something wrong, like not giving your Groups unique names. See those named Groups in the upper-right? That's how to do this. Keep the names long and descriptive so that you cannot possibly be confused about what part's what!

Assuming that the CMP exports without crashing MS3D... turn it upside down, and then export it as OBJ... and import it into your uvmapping utility of choice. You can do your entire skinning process in Milkshape... but quite frankly, it's fairly difficult to use, compared to UVMapper Classic which is freeware, and has a GUI.

This section of the Tutorial will cover making a single uv-map texture for your ship, using UVMapper Classic. Trust me, you'll like it


First, we're going to open up the OBJ version of the model with UVMapper Classic. It's going to look like this. This... is bad. As you can see, the model's parts are all overlapping one another, and they're not laid out in any coherent fashion. If we tried to put textures on it as-is, we'd be hosed. So, we're going to fix this.


For our very first step, we need to give the entire ship a planar map. For those of you who aren't sure what that means... a planar map is a flat representation of a ship's geometry- it's as if we were viewing the ship without any perspective after it has been flattened out. This is a great type of map to use for simple things, small detail areas and (duh) flat surfaces. It's not so hot for anything with curvy surfaces, though, so bear that in mind- planar maps aren't what you'll want to use for everything.


These are our settings for this planar map. This is just a very simple map that we're going to use for our next steps, so you don't even have to be this persnickity about your settings, but it helps to use a standard method.


Soooo... we now see a top-down view of our model. But it looks... rather... distorted.

Unfortunately, this is one of the reasons that UVMapper Classic is freeware. Pro doesn't distort things. That said... Classic allows us to fix this distortion.

Hold down your left Shift Key and hit the Y and X keys. These are shortcut keys that allow us to scale things on the Y and X axis. Basically, we need to hit Y twice and X quite a bit... and compare the wireframe we're seeing here with the wireframe view in MS3D, to achieve a distortionless view. Technically, we really don't have to worry about this stuff during this initial step- we could just do it for every subpart, and skip all of this.

But I don't. It only takes 30 seconds... and it allows us to get into the habit of thinking about our ship's parts and their scaling, and work appropriately.


So, now let's Select All...


...and keep shrinking it and comparing it to the MS3D version, until they both look the same.


Now, here's where things start getting exciting (and a little more complicated). We're going to start selecting those Groups we laboriously created as part of the modeling process, and use them to help us skin this ship, using different mapping methods. In the screenshot above, you can see me selecting By Group, which allows me...


...to select MainBody_Argh_DemoShip. Is my anal-retentiveness about naming conventions starting to make sense now? I hope so


Whoa!! We've selected... a very specific part. Woot! Now it's time to use a different mapping method, so that we can texture it to the best of our abilities.

The MainBody part is, if you think about it... basically just a cylinder. So...


...we're going to left-click and drag it where we want it (or use the Arrow Keys- Shift + Arrows moves a larger distance- this shortcut's extremely handy with small parts btw).


Now we're ready to try a new mapping type- a cylindrical map.


Now all of your "leet" 3D skills come into play. If you've positioned your ship in Milkshape correctly before export (you didn't skip that step, right? ) then the model's main axis is now on the Z. It's also "upside down"- i.e., the negative Y axis is "up".

What all of this boils down to, in this case... is that this cylindrical ship's cylindrical body should be set up on the Z axis... so that we're "rolling it out" along the axis that it's aligned with most.

This rarely works out so perfectly in practice- but I built Demoship so that it's mainly very easy to skin.

Here are the settings we're going to use. Once again, I'm using scaling, even though that means I'm going to have to re-scale it later.


Here is the result... a little big, eh? Repeat the scaling steps that I demonstrated earlier (shift + X, shift + Y)... and pretty soon...


... I have a nice little map. See how different this cylindrical object looks, now that it's "unrolled"? It may seem a bit weird, but this is a much more "perfect" representation of this object than almost anything else we could do.



Now... rinse and repeat.

I really strongly urge everybody to use every type of mapping on their first ships, and just try 'em out for awhile, just to see what they do. I almost exclusively use planar and cylindrical mapping methods, but the others have their places. For example, spheremaps are about the only mapping type that handles curvy objects well. The results look weird, and you have to make guidelines, but you can do some incredible work with them. Still, most of the time... I'm just too darn lazy I don't do this for a living, so I just do whatever will get the job done at the level of quality I require as fast as I can.

As you lay out your parts, you just want to move them around on the screen, taking great care not to have two parts too close to one another. Don't be afraid of wasting space, but don't just leave gigantic white space if you can help it.


Now we're done. It's time to save the model . The model needs to be saved, because it has been changed- uvmapping actually re-arranges the polygons and their surface normals (which, if you don't know what they are... look them up on Google, because that's waaaaaay beyond the scope of this Tutorial).


Here are the save settings.


And now we need to save the Template texture. UVMapper Classic only saves BMP versions, but everything used for graphics work, including Paint, can work with BMP. Yup... you could skin in Paint. Not that I'd want to...


And here are the settings we want to use there.


********************************************************************************************
********************************************************************************************
********************************************************************************************
Time to Paint!



Before I start "getting serious" about painting my ship up, I've decided that the centerline of the ship's main body will be very important later (a decision that turned out to be entirely correct later). So I made a seperate Layer in Photoshop and drew these two red lines marking the centerline of the ship before going on to the next step. Why a second Layer? Because the next steps are going to obliterate the originals, is why.


First, I used the Magic Wand tool, set at a Tolerance of 0, Contiguous = YES, and clicked on the white outside of all of the areas I'm going to be painting.


Now Select Inverse. We want the areas we're going to paint, not the other stuff.


Now I'm Expanding the selection. This is very important. Uv-maps, for whatever reason, need a bit of "bleed" around their edges- they're not 100% accurate. Generally speaking, I use a "bleed" of 14 for 2048X2048 maps, and halve it for 1024X1024, halve it again (to 4- round up) for 512X512 maps, etc.


Once I've Expanded the selection, I make a new layer Via Cut.


Now I've used the Paint Bucket to fill the formerly white areas around the painting areas with a dark color- preferably a dark but neutral Gray. This also helps with "bleed" issues in the final model.


Now I'm about to save this texturemap for the very first time. I just want to make sure that it's accurate and correct, including the centerlines that I drew earlier, so I used the Paint Bucket with a Tolerance of 255 to fill in all of the painting areas with colors that I think are vaguely like what the final paintjob will be like. I'm not detailing anything a this point, because I may have made a mistake, and I want to check it out first.


Here are my standard export settings for the DDS Export Plugin. This is a 2048X2048 texturemap, so expect it to take a fairly long time to export- about 5 seconds, on my machine... your milage will vary.


In this shot... you should immediately see that the model's been very radically changed, even though we haven't put any textures on it yet. What's important here is the Groups menu on the upper-right. See how I just have 3 Groups now? I selected the areas that are going to glow later on, the glass areas, and everything else... and used Regroup to make them 3 Groups, with totally unique names . Even if you've been sloppy about naming conventions up 'til this point... you're OK. But if you don't give these 3 Groups totally unique names at this point... you're hosed! Don't make any mistakes...


Now I have created 3 Materials with totally unique names , and EACH OF THEM have been assigned that DDS texture I just exported. See that button with "demoship copy" on it? That's the texturemap being used. All three Materials are using the same texturemap. This is much, much MUCH simpler than the alternatives.


Now... just keep painting... rinse and repeat. After some hard work... you will have worked on your texture until it looks quite a bit better... adding small detail areas, texture, and fake lighting. I'm not going get into the artistic side of this- remember, this isn't a Tutorial on how to rock at Photoshop, or how to be a decent artist. But, as last shot shows... from humble beginnings, we can get to some pretty neat places

Edited by - Argh on 6/7/2005 7:10:08 PM

Post Sat Jun 04, 2005 2:41 pm

Finalizing your Model

These final steps will take your model and make it sing and dance in the Freelancer game engine. Now we're going to make use of the glow_glass and glass Materials and have the game engine display them correctly!

Immediately after exporting your skinned ship... export the MAT (in my case, I use the "update existing CMP/MAT" option, and always export the MAT into the CMP, because it's sooooo much easier that way)... and go look at your model in HardCMP before doing anything else.

Let's look at the screenshots. Again, the comments are below each shot.


When you first export a model with textures named "something_glass" and go look at it in HardCMP, the "glass" areas are going to be totally black, like the shot above. This is a bug in the MAT Export Plugin... it basically doesn't "understand" that people might want textured glass Materials, and assumes that everybody wants simple OcDc- an Opacity Channel and Diffuse Channel only. Well... that may suit beginners, but it doesn't suit me. Besides which, it's also making my Glow areas not show up. Time to fix it


Open up UTF Edit, and open the ship's Material Nodes up, for the glow_glass and glass Materials. This is what they're looking like, right after export. Not what we want.


Now we've added/subtracted everything we needed to. Note that the glow_glass and glass entries are completely different. DcDtEcEt textures do not need any OcOt entries, and the inverse for DcDtOcOt textures. Take a good look at DemoShip's setting with UTF Edit and copy them, until you're feeling brave enough to use alpha channels (a techique I avoid whenever possible, because it greatly increases the time it takes to skin a model).

For those of you who'll be reading this a long time from now, perhaps after I'm long gone... here are some notes about settings:

Dt_flags, Ot_flags and Et_flags are all the same. They're all Integers, and they need to be set like this:

64
0

Ec (this is the "glow" channel)is a Float, and needs to be set like this. The arrows indicate a range that is valid- higher/lower values will, most likely, crash FL.

0.000000 --> 1.000000
0.000000 --> 1.000000
0.000000 --> 1.000000
0.000000

Oc (the opacity channel) is also a Float, but it only has two values:

0.000000 --> 1.000000
0.000000

Dt_name, Ot_name and Et_name should all have the same String value- the name of the Material you used for the "not-glowing-or-transparent" part of the ship. This may seem counter-intuitive and tricky, but that's what we need to do here. So, for example... this ship's values for these things... for all three Materials... is "Argh_DemoShip_TEX.tga".


After saving the modified CMP... take a new look in HardCMP. Voila! We now have everything right!

And when you view the results in the game engine... it will be worth it. Once you get used to glowmaps, they can give objects a great deal of life they'd never have otherwise

Edited by - Argh on 6/4/2005 3:43:03 PM

Post Sat Jun 04, 2005 3:30 pm

Wow, I think this should be alot easier now. Hope I didn't annoy you too much with my pestering.

Thanks for the excellent tutorial.

Post Sun Jun 05, 2005 8:28 am

And here's the final beauty shot:

Post Tue Jun 07, 2005 10:31 am

Harrier, are we going to sticky this? Or do you think I should rewrite the section about uv-mapping and go into detail, or "borrow" that from your Tutorial? I feel like this covers the specific issues of large uvmaps, DDS settings, glow and transparency maps pretty well, but it's pretty sketchy on the details of uv-mapping. I may just re-write that bit later this week and make s'more illustrations, if we're going to sticky it- it'd be better if it was complete.

Post Tue Jun 07, 2005 3:39 pm

Do it, it'll make my job easier when I make that tutorial.

Post Tue Jun 07, 2005 6:12 pm

Ok, I've added a step-by-step section on exactly how to use UVMapper Classic...

Post Wed Jun 08, 2005 7:00 am

Holy crap that was a million times easier than I thought it was. Keep checking back I should have a few screenies up in a few minutes.

Post Wed Jun 08, 2005 4:57 pm

Argh,

Yes this thread should be stickied.. too many stickied threads can load up the thread, and other stuff gets lost..but I will sticky this..

I feel there is a need for a comprehensive guide to texturing, so feel free to 'borrow' what you wish, there is a large amount of info in several threads but in order to find it all means trolling through a fair number of threads.. To have it all in one thread would be a boon to us all..I have learned some since I did that original tutorial, and have considered updating it,, so if you need something from me please don't hesitate to ask. One thing to consider.. not all modellers use single .mat files for all textures (myself included) so these methods, if gone into in some detail, can be offered as well..Tile and box mapping could also be part of it as these methods can provide high detail in fairly small texture sections.. etc..

It would be nice to have information collected in a couple of comprehensive threads;
One for Modelling - An update on Drizzt's tutorial, and the tutorial by Imagine..I understand AlumiumHaste is working on something along these lines...
One for Texturing - An update on the various texturing methods, hopefully combining the best from both.. tho I'm not volunteering you.. Argh.. but since you offered...

once these 'tutorial updates' are done those 'old' threads, can be unstickied as I havent seen either of the originators here for many months and these threads should be updated to take in different/new methods.

Does this suit?

Harrier

Post Thu Jun 09, 2005 5:02 am

That sounds like a plan- I'll try to get more of this done this evening, and go through face-mapping, tile-mapping, and using quick cubical projections in MS3D. Those are all good techniques for specialized stuff- I've been trying to stick to texturing techniques that will work for beginners, as well as including glowmaps and transparency. As for MAT file issues, I'll try to think about how to talk about that and get that figured out- I've gotten very used to just exporting my MAT into my CMP.

Post Tue Jun 14, 2005 9:52 pm

Argh,

One question..Is it possible to control the level of illumination..? i.e. a soft glow rather than bright light?.. I have never been able to figure out how to 'soften' the glow.

Harrier

Post Wed Jun 15, 2005 5:39 am

Absolutely. There are two methods to achieve that goal.

1. Always use less than 1.000000 in the Ec channel. Tune it downwards until it's where you want it. If you run into a problem where one area needs very subtle lighting and another needs much more dramatic lighting... go back to the model, and make two Groups. I haven't run into such an issue (yet), but it's possible that you may want one area to just have a very, very subtle glow.

2. Use much more subtle gradients in your painting, because you already know that the alpha levels are going to be higher than your original painting. For example, if you look at DemoShip in the XML Toolkit Mod 1.2 (where it's fully implemented and you can buy it) you'll see that many of the areas of the painting in the ship's skin that aren't all that bright are much brighter when implemented as a glowmap. I plan my glowmaps around this, and paint accordingly... and then I dial down Ec and take another look in the game, several times, until I'm sure I have what I want.

Basically, the secret to really nice glows is subtlety. Bad glows are usually:

1. Painted with colors too near to white. When the Ec is applied, this means that they wash out really badly. When in doubt... go darker, not lighter- you can always fix it later, preferably with Curves manipulation rather than Brightness/Contrast.

2. Painted in very un-subtle blocks, instead of taking into account the way that light will diffuse through IRL objects.

To make the best use of light... study light. Glowmaps require that you know enough about how classical painting techniques work to really render lights with a natural feel. My principal models when I'm thinking about glowmaps are any lightsources with covers that their light diffuses through, such as ordinary table lamps, flourescent lighting, etc. Think about how their light is brightest nearest the light, but darker around the edges- and it's usually a smooth gradient. No light shining through something else is going to be totally pure in shade and hue.

When painting up the models, I'm usually very careful to work with the airbrush, gradually painting in from the edges of the geometry. I'll export the DDS and take a look in MS3D over and over again... and then, when I've gotten the ship coded up and everything else is perfect, I'll take a long look at the glowmap areas, and repair any goofs- after all, we can use UTF Edit to re-import the texturemap, so why leave the texture less nice than what we were shooting for?

Post Sat Aug 20, 2005 4:28 pm

Hello everybody, can I have some helps for make texturing, because I've all understand but juste for make the CMP and MAT file. When I update the CMP file with my finished Milkshape file and I make the MAT file, I open this two files in hardpointseditor but I canno't see the texture... All is white...

I thanks in advance somebody help me...
Next

Return to Freelancer 3D Modeling and Texturing Forum

cron
Hosted by The-Starport
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.