About This Tutorial
A few months ago, I stumbled upon this submission from Rozzy85 and I tried it out. It's a .MAX file that sets up some lighting things, and the renders turn out awesome. Sadly, it crashed my 3DS Max every time I tried to load it. So I gave up on it.....until now. For some reason, everything loads up properly now, so I've been taking advantage of that fact and I've been re-doing the render images for all my skin submissions.
One thing I noticed about Rozzy85's .MAX file was the lack of detail in his "guide" that he included. I had a hard time finding the "Falloff" option, and then I was having an issue where my render image was coming out all screwy....but I've fixed it! I know what to do now. I know how to properly utilize Rozzy85's .MAX file.
So I decided to create a step by step tutorial to show everyone who is like me, and who has 3DS Max, but hardly knows how to use it, how to create awesome render images for their submissions.
What You Will Need
- GCFScape (to extract the model files from the GCF)
- MDLDecompiler (to decompile the model files)
- Notepad++ (Notepad will also work, you'll need this to change a bit of text in the .MDL file)
- Autodesk 3DS Max (2008 and up)
- 3DS Max SMD file import plugin
- 3DS Max VTF import plugin (Optional, you can convert the VTFs to TGAs and import the TGAs. It's your choice, really)
- This .MAX file which was created by Rozzy85
For the tutorial, I'll be using Autodesk 3DS Max 2011.
A note regarding models that use more than one main VTF for its skin
Before I get into the tutorial, I have to explain something. You may run into issues when creating a render for a model that has more than one VTF file for it's texture (excluding normals/bump maps/lightwarp VTFs). For example, if you try to get a render of the Killer Kabuto, because the Killer Kabuto has one VTf for the "horn", and a second VTF for the hat itself, the textures will appear screwed up. I'm not exactly sure how to make 3DS Max properly apply both textures to the model. If you're not exactly sure what I mean by "screwed up", take a look at these screencaps that I took whilst trying to make a render of the Killer Kabuto:
I applied both textures to the model, as you can see here...
And this is what I got.
I tried switching the textures around, and this is what I got.
Step 1: Choosing the model and decompiling it.
First things first. We need to figure out what we want to make a render of. For this tutorial, I'll be using the Spy's Disguise Kit.
I've already extracted the following files from the "team fortress 2 materials.gcf" file:
- tf/models/weapons/w models/w cigarette case.dx80.vtx
- tf/models/weapons/w models/w cigarette case.dx90.vtx
- tf/models/weapons/w models/w cigarette case.mdl
- tf/models/weapons/w models/w cigarette case.phy
- tf/models/weapons/w models/w cigarette case.sw.vtx
- tf/models/weapons/w models/w cigarette case.vvd
- tf/materials/models/weapons/v cigarette case/v cigarette case.vtf
Now we have to decompile the .MDL file. If you have Notepad++, now is a good time to use it. Right click the "w cigarette case.mdl" file, and select "Edit with Notepad++". If you're using plain old Notepad, just double-click the .MDL file, then when the "Windows can't open this file" popup appears, click "Select a program from a list of installed programs", and choose Notepad.
Once you've got the .MDL file opened in Notepad/Notepad++/whatever text editor you use, right at the beginning of the file you'll see "IDST0". Some other .MDL files such as the untextured, scrapped Grenade .MDLs will have "IDST-". Simply change that bit of text to "IDST,", then save the file (don't save it as a .TXT, just click "File" > "Save".
Now fire up MDLDecompiler. Under "Choose Model File", navigate to the .MDL file that you edited in Notepad++/Notepad/whatever and select it. Under "Choose Output Directory"....choose where you want MDLDecompiler to put the decompiled files. Make sure all 3 boxes are unticked as well. Finally, click "Extract" and then click away the popups. Ta-da, you've got the required SMD file(s).
Step 2: Importing the model into 3DS Max
Fire up 3DS Max. Once it has loaded, click this little button in the top-left corner of the screen:
Select "Open", and navigate to where you saved that .MAX file which was created by Rozzy85. Open that .MAX file. You will most likely get a popup informing you of missing materials, just click Continue.
Once everything has loaded, in the 3D render window, click on the model that has already been loaded (it appears to be a custom TF2 weapon model, probably called the "Sparkshot"), then press "Delete" on your keyboard to remove it. Click that little button in the top-left corner again, but this time select "Import". Navigate to where you had MDLDecompiler extract the SMD files, and select the SMD file.
NOTE: For the tutorial, I'm using the Spy's Disguise Kit, so the SMD file I want to use is named "w cigarette case reference.dmx.smd". Depending on the model that you, the reader, are using, it most likely will be named in the same fashion (for example "w minigun reference.dmx.smd")
Upon choosing your model's SMD file, there will be three popups. For the first popup, "Pre-parse options", make sure both boxes are unticked, and click "Ok". For the second popup, check out the image below and tick/untick the boxes on your popup if they don't match the image. Once everything matches, click "Ok". For the third popup, just click Ok.
You should see the model in the 3D render window now.
From here, adjust the models position so it's positioned the way you want it. For repositioning the model, you have two ways of accomplishing this. The first way involves these two buttons on the bar at the top of the screen:
The second way involves some keyboard shortcuts and is much more precise. Basically, just press the up arrow and your cursor should turn into a circle. Once it is a circle, you can use "W" to zoom in, "S" to zoom out, "A" to pan left, "D" to pan right, "E" to pan up, and "C" to pan down. As for rotating, just click on this thing in the top-right corner of the 3D render window, and drag your mouse around while holding down the button to rotate.
So once you've repositioned the model all fancy, you're ready for Step 3, applying the model's textures.
Step 3: Applying the model's textures
Time to add the textures to the model. Press "M" to open the Material Editor window.
First thing you need to do on the Material Editor window is scroll down that bottom area where you see "Extended Parameters", "Super Sampling" and "Maps". The "Maps" section is where we need to go, so scroll down to it. It should look like this:
First things first, untick the box beside "Specular Color" (it should have "C Sparkshot Mask.psd" chosen, but that file is nonexistent). To apply the model's textures, we need to focus on the "Diffuse Color" bit. To the right of "Diffuse Color" you'll see that little button that says "Map #0 (Falloff)". Click that and you should see this:
Time to apply the materials. Click the button that says "Map #3". You should now see this:
From this window, you'll see "Bitmap:" and then a button with a filepath on it. Click the button and navigate to the model's VTF file that you've extracted. If your "Browse" window isn't showing VTFs, click the "Files of type" drop-down list and change it to "Valve VTF Texture (*.vtf)". Once you've found the model's VTF file, select it.
Back to the Material Editor window. On the Material Editor window, below those 3D circles at the top, you'll see a drop-down box beside a "Bitmap" button. Click the drop-down box and select "01 - Default".
You'll be brought back to this section:
Now repeat what you just did; Click "Map #0 (Falloff)" and you'll be brought to that "Falloff Parameters" window again. This time, click the "Map #7" button, navigate to the VTF file again and select it. You'll notice that the little 3D sphere at the top of the Material Editor window has been wrapped with the model's texture. Now for the easy part. Click on that sphere and drag it to the 3D render window and hover over the model itself until you see a little popup that says "SMDImport". Once you see it, drop the "sphere" onto the model.
If your model has its own lightwarp VTF or bump map VTF, you can go back to the main screen by clicking that drop-down box that says "Map #3" or "Map #7" and clicking "01 - Default". From that main window, just click the box to the right of "Bump" if the model has a bump map. If the model has a light warp, you can tick "Specular Color" again and change the "C Sparkshot Mask.psd" to the model's lightwarp VTF. Just remember to drag the sphere onto the model if you add a bump map/light warp file so the changes get applied.
Let's take a look at the Disguise Kit that I've just textured after following this guide. Don't worry about the texture looking low-quality; once you create a render image with 3DS Max, the rendering process jacks the texture quality right up to high quality. Also, ignore those 3 white orbs. Those are the "weapon bones", and they do not appear in the render image.
Now that the model has been textured, it's time for Step 4, and Step 4 involves phong lighting....or at least the 3DS Max way of recreating phong lighting.
Step 4: Phong lighting
Oh yeah, did I not mention that Rozzy85 also set up an "Omni light" to replicate phong lighting? I didn't mention it? Hmm, well he did. He set up the Omni light for us. Isn't he awesome? To find the Omni light, in the 3D render window, you have to zoom out quite a bit to see it (use your mouse's scroll wheel, if it has one).
You might want to drag that a bit closer to the model, then zoom in just enough so that you can move the omni light around while watching the model so that you can get the "phong lighting" from the omni light to look the way you want it to.
Onto the final step of this tutorial. Step 5. Rendering an image!
Step 5: Rendering an image
This is by far the simplest part of the tutorial. So far, you've chosen your model, decompiled it, imported it into 3DS Max, repositioned it and rotated it until you got it posed the way you want it, textured it, and then adjusted the built-in phong lighting to your liking. Now it's time for the payoff.
All you have to do is press F9. 3DS Max will popup with a neat little render window.
REMEMBER: If after you press F9, the preview looks a bit small, you can always close the render preview and zoom in a bit closer (either scroll the mouse wheel, or press the Up Arrow key, then press W to do a fine zoom). If the angle looks a bit off, or if the bucket-style lighting doesn't look quite right, you can always rotate the model and play around with how you've positioned it until you get it to look the way you want it to look.
Now click the little disk icon on the left side of that window (below the dropdown box that says "View"). Save the image as whatever you want to name it, and wherever you want to save it to....BUT! Always remember to save it as a .TGA file by clicking the "Save as type" dropdown box and choosing .TGA, otherwise you'll lose the Alpha layer (which is a big help when it comes to using Photoshop to remove the black background). When you save it as a TGA, you'll get a popup with some options. Make sure "32" is selected for "Bits-per-pixel", and that "Pre-Multiplied Alpha" is checked off. You can fill in the additional information areas if you want to.
And you're done! You've just created an awesome bucket-style render image that looks way better than any render image created with Source SDK's Model Viewer!