The Source Model Compile Workflow Tutorial

By 303 (Aka: TheCorp303)


BEGINNER INTRODUCTION

I have created this guide with the purpose of making a simple source model compiling workflow with minimal QC editing. I will try to make this as general as possible so any 3D package with an SMD exporter should work.

Now before I begin, if you are just in to make TF2 hats and weapons for workshop, refer to these TF2-specific tutorials:

Hats
Weapons

Now if you are a 3DSmax user, I recommend you use Wall Worm Model Tools

This stuff is really powerful and gives you loads of options, but there is some setup required and a bit of a learning curve. If you are into making lots of stuff and have lots of time, Id go with WallWorm. Okay with all that out of the way, lets get started.

WHAT YOU WILL NEED:

Cannonfodder's StudioCompiler
VTFEdit
GCFscape

An SMD exporter for your modeling program:

Blender SMD exporter
3DSMAX SMD exporter
Maya SMD exporter
Softimage SMD exporter

Note: Milkshape3D already has SMD export


MODEL PARTS TO PREPARE WITH YOUR MODELING PROGRAM

Your Reference model [ex: model_reference.smd ]

Sequences [ex: model_anim_01.smd ]

LOD meshes [ex: model_reference_lod1.smd , model_reference_lod2.smd , model_reference_lod3.smd ,etc ]

Another important thing to note is that you don't need to skin/weightmap LOD meshes. The reference mesh weights are passed down to these

Physics Collision mesh [ex: model_collision.smd ]


TEXTURES TO PREPARE

All your textures should be in a valid power of 2 size TGA format. If you are including an alpha channel (used as transparency or spec/phong masks ) make sure you saved the tga as 32bit. If it has no alpha save it as 24bit. If you see a checkbox for "RLE compression" uncheck it.


COMPILING THE MATERIALS

I'm going to begin with texture compiling because this guide forks off into multiple prop types so repeating this at the end of each prop would get redundant. Now, Studiocompilers material compile seems broken to me as it does not sync with vtex.exe properly, So we will be using VTFedit to make our textures (also you have far more control).

first, open your texture TGA with VTFedit.

If your texture has no alpha channel use these settings:
Normal Format DXT1
Alpha Format DXT1

If your texture DOES have an alpha channel use
Normal Format DXT1
Alpha Format DXT5

Leave create mipmaps checked, as mipmaps are good for optimization at distances and smoother transitions.

One thing of note: Do NOT use uncompressed texture formats for ingame stuff unless you absolutely have to or if you are doing machinima/SFM stuff! Seriously the only time you ever have to use BGR888 (uncompressed no transparency) or BGRA8888 (uncompressed with transparency) is for certain things like normal maps that look too jagged in DXT compression.

Now decide on a directory for your model materials. For the purposes of this guide I am going with this one:

Uncheck automatically create VMT in options in vtfedit Save the VTF to your custom dir with the SAME FILENAME as your original TGA.

Make any additional VTFs for other textures/masks/normalmaps/etc. If you are making a normal map check the "normal map" flag before saving it.

With your base texture still open in VTFEDIT (if you made additional VTFs, close them and open your base one) Click create VMT file and set the shader to Vertexlitgeneric, then add any additional VTFs you created to the textures list. One thing is if you are using a normal map you need to specify it in "bumpmap" not "normalmap". I believe "bumpmap is for refract/water shaders.

Tutorial 1: Compiling a Prop_Static

Tutorial 2: Compiling a Prop_Dynamic

Tutorial 3: Compiling a Prop_Physics

Tutorial 4: Compiling a Simple Ragdoll

Tutorial 5: Compiling a Full Character Ragdoll