An expansion/overhaul mod of epic proportions, with entirely rebalanced gameplay, expanded factions, new gametypes, graphical overhauls, and five new factions; stealth-based Confederate Revolutionaries, tower defense-inspired Atomic Kingdom of China, economy-focused Mediterranean Syndicate, DotA-esque Order of the Talon and spammy Electrical Protectorate.
The skinny on unwrapping 3d objects in 3DS Max, plus background on Diffuse, Specular and Normal Maps.
Posted by ferriswheel42 on Sep 18th, 2009
Hey guys, I figured that since certain non-specific mods have yet to release textured models, it would be beneficial to the Red Alert 3 Modding Community to put up a texturing tutorial. Please note that there are a ton of different ways to do this, and my method describes what I think is the easiest way to go about texturing. If you have anything to add, or you see something that is incorrect, please send me a PM as soon as you can. Thanks, and enjoy!
The goal of this tutorial is to educate people on how to unwrap and texture in 3DS Max and other 3rd party programs. By the end of this, you'll be able to fully texture a model that can be used in Red Alert 3 mods.
Before we get started, please take a look at this tutorial by Koroshiya_Ichi: Moddb.com , which covers the basics of 3D textures in general, and will be useful to keep in mind while going through this tutorial.
3DS Max 9 or higher
A Photo Editing Program (See Below)
Red Alert 3 (1.12 Patch) and the Mod SDK (Portal.commandandconquer.com)
CrazyBump, or a similar program that creates Normals from a height map.
While Photoshop is an excellent tool, it can be a bit pricey (especially after buying 3DS Max 9). Here are some cheaper alternatives that can get the job done just as well:
Here's the situation: You have a beautiful model that you just finished making in 3DS Max. You've done a bunch of renders of it and sent them off to the interweb for critique, found out that people there love it almost as much as you do. Wonderful! So... Now what?
First things first. Before you even think about closing up 3DS Max, you should first unwrap the UV coordinates of your model. What are UV Coordinates, you ask?
Wikipedia.org wrote:To put it simply, UV texturing permits polygons that make up a 3D object to be painted with color from an image. The image is called a UV texture map, but it's just an ordinary image. The UV mapping process involves assigning pixels in the image to surface mappings on the polygon, usually done by "programmatically" copying a triangle shaped piece of the image map and pasting it onto a triangle on the object.
Now that we know what we're dealing with, let's get to work. First, with the model selected, go to the "Modifiers" menu, then go down to "UV Coordinates", then select "Unwrap UVW". This will bring up the Modifiers Tab on the right-hand side of the screen, as well as automatically add the "Unwrap UVW" modifier to the list. Below this, you'll find three boxes: "Selection Parameters", "Parameters", and "Map Parameters". Under "Parameters", click on the "Edit..." button. This will bring up the UVW Editor.
Chances are that you'll be greeted by a mess of green and white lines on a blue-white grid. Before you panic, take a deep breath, and try to get comfortable. The best way to go about this is to start planar mapping all large, flat surfaces. Don't go straight for the cylinders or more complex shapes just yet, or you'll get some very wonky results. To planar map a surface, start by selecting the polygons that compose it.
Once you have a whole side selected, click on the "Quick Planar Map" button under "Map Parameters" (make sure that "Averaged Normals" is selected). What you'll see in the UVW Editor is a 2D representation of that face, or side. Drag it off to the side of the UV map for now, once we have it mapped, we move on to the next few sides.
After all the larger surfaces have been mapped to 2D planes, it's time to get to work on the cylinders and more complex shapes. To map a cylinder, select all the side faces (Not the top and bottom. Those should be mapped separately), then look under the "Map Parameters" section again. Click on "Cylindrical", then click on "Best Align" once it is selectable. If you have problems, make sure all the faces are selected. If you have accidentally forgotten to select a face, click on "Cylindrical" again (this will allow you to select faces again) and then use CTRL+Left Click to select the missing faces. You'll have to click on "Cylindrical" yet again to re-map the UVs. Once you're satisfied, deselect "Cylindrical" for the final time. Again, drag the cylinder UVs (which should actually look like a square with parallel vertical lines through it) to the side of the UV map, where it won't get in your way.
If you have a complex shape that needs to be mapped, select all the faces, then in the UVW Editor, click on the "Mapping" menu, then go down to "Normal Mapping". A little dialogue box shows up. Where it says "Back/Front Mapping ", change it to "Box Mapping", keeping all the values the same. This should break your complex shape into a bunch of separated parts which will be easier to map. Note that if the shape being referred to here is a wheel, or something else that is "circular", it would be easier to use the above method. Again, drag the mapped UVs to the side.
Once you have all the major objects mapped, check your UVW Editor. If there are any green lines left over (on more complicated models there likely will be), select them in the editor, and look back to the main viewport to see where they match up to on the model. It is very possible that you will have missed a few faces, or even objects. Once those have all been dealt with, it's time to save your UVWs (in the UVW Editor, go to File>Save - any filename will do for now).
Now it's time to scale the mapped parts and rearrange them on the UV map (which is indicated by thick, dark blue lines). You'll find the UV editing tools underneath the menu bar in the UVW editor. It's best to play around with these first to get a feel for the tools.
The key to good mapping is preserving space. The biggest parts of the model should take up the most space on the UV map, and should be scaled only slightly. The smaller parts should take up less space, and any part of the model that is unseen should be scaled as small as possible, or kept at the side of the map.
Any symmetrical face or object should have its UVs flipped over. To do this, select only half of the face, then click the "Break Selected Vertices" button. Then you can either go to the "Tools" menu, or simply click the "Flip Horizontal"/"Flip vertical" Button below the menus.
Once you've fitted all the appropriate pieces of the model into the UVW map, you can begin editing. Below is an example of a moderately decent UVW map (with grids removed).
To export to an image file, go to the "Tools" menu and select "Render UVW Template". A dialogue box should appear. Change the width and height dimensions to 512x512 (or 256x256 if it's a smaller model), then click the render button. If you're happy with the way it looks, click the little "Save" icon, and save it to a folder on your computer (preferably the same folder where your model resides. If that happens to be "My Documents", make a new folder, move your .max file there, then save your image to the same location). It's best if you save your image file as a 32-bit Targa (TGA), which is the file format used in Red Alert 3.
Now it's time to open up your newly created TGA file in the photo editor of your choice (MS Paint is not recommended, as it cannot open or save TGA files).
First off, copy the background, change the background to a solid colour (instead of transparent), then paste the background onto a new layer. Change this new layer's blend mode to "additive" so you can see the only the white/green lines. Now, you get to paint!
Like painting a regular picture, texture mapping is roughly the same. The "Diffuse Map" is a fancy way of saying "Colour". This means that the basic colours (without shadows, highlights, or teamcolour applied) of the model are determined by this TGA file.
Start with a basic colour of your choice (for me it's usually grey), and fill in all the basic shapes on the image with it (layer 1). On a new layer (layer 2), add lines, pipes, paneling, rivets, the list goes on. Add another layer (layer 3) to denote teamcolour (just use a bright blue or red for now), then when you are finished, hide this layer (layer 3). The topmost layer (layer 4) should be reserved for grime, weathering, and other fine details that make the texture look more realistic. You don't really *have* to have the layers organized like this, but if it's your first time texturing, it's best to stick to something simple. Now, save your file in a format that supports layers (in case you need to edit it in the future). Format examples are PSD, or the native file format to your program.
Once you're happy, save this file in the following naming convention: (First letter of the faction)(First letter of the object type)UnitName.tga
i.e. AUCryocopter.tga <-- (Allied)(Unit)Cryocopter
or CBWarehouse.tga <-- (Confederate)(Building)Warehouse.tga
Specular maps are a channel-based image that controls the "shiny-ness" and reflectivity of the model. It also controls the teamcolour.
Specular map channels can be described as such:
So... Purple = Shiny and has teamcolours; Yellow = Shiny and Reflective; Cyan = Reflective and has teamcolours.
The brightness of the channel determines the quantity of shininess/teamcolour/reflectivity.
The best way to start making a Specular Map is to flatten, or merge all the layers except the one with the team colours. Then, remove all the colour from the image except red (you may have to consult a tutorial for your program on how to do this). Then, create a layer of pure black, set it to "multiply", and bring its opacity/transparency to 50%. Remember, bright red means that the unit will be practically "glowing" with sunlight in-game, so you don't want it to be too strong. In some areas, you can use a white brush on your black layer to negate the "multiply" effect, and make certain sections brighter.
Next, un-hide the team colour layer, and colour all the sections blue. Depending on the effect you want, you might bring the team colour layer above the black layer. If there is any reflectiveness you want to add, make green/yellow sections on yet another new layer. in the end, you'll end up with something like what is shown below. Before moving on, save your file in a format that supports layers again, but label it as the Specular map.
Now, save the image as a TGA, using the same naming convention as the Diffuse map, but adding "_SPM" to the end.
I'll refer you back to the tutorial I suggest you to read earlier (Moddb.com) because it describes a different technique for creating a normal map. He also describes them a lot better:
Koroshiya_Ichi wrote: No it's not the opposite of an abnormal map (seriously I am so dam funny). Normal Maps are used to give the appearance of indentations, subtle geometry and imperfections upon a surface which would be totally inpractical to build in actual 3D geometry. Particularly when used in Dynamic light settings they can produce fantastic results.
Now, if our model was a concrete wall, or a rock of some kind, we'd want our Normal Map to be very bumpy and full of cracks, etc. But since you're more likely texturing a sleek-looking tank, or a brick building in my case, you might just want to stick to a flat, simple Normal Map that only has lines, pipes, paneling, etc. Hey, didn't we have a layer in our Diffuse Map that contained that stuff? Hopefully you have the original file of that saved, or else you'd have to re-make it again from scratch.
Basically, colour everything but your lines, etc. layer 50% gray. Anything you want to appear indented should be re-coloured white, anything extruding be made black.
Save the file again, in a format that supports layers, as well as a TGA with the suffix "_NRM" (see Specular Map for equivalent naming convention). Now, open up Crazy bump, import your newly-created file and fiddle around with the settings until you get a decent, crisp normal map.
Save this file again, overwriting your previous file.
And now you're done making the files!
You should have:
A Diffuse Map: CBWarehouse.tga
A Specular Map: CBWarehouse_SPM.tga
And a Normal Map: CBWarhouse_NRM.tga
Now you can get those textures onto your model. Go back to 3DS Max and hit the "M" button on your keyboard to bring up the Material editor. Click the button that says "Standard", then select DirectX Shader. Select "Discard Old Material", then look below under the collapsible box that says "DirectX Shader". Click on the button beside "Reload". Now, navigate to where you saved your Red Alert 3 Shaders.
If your model is a building, choose a building shader. If it's a unit, choose an "object" shader. Since I created a building, I'm going to select the "BuildingsAllied.fx" shader. Now, you'll see that the menus below have changed. Click on the topmost button that says "None", and select your Diffuse Map texture. Do this for the other "None" boxes, replacing them with the Normal and Specular Maps.
If you're making a building, you'll notice there is a fourth texture - Damaged. This texture only displays when the building is severely damaged. Usually it looks the same as the diffuse texture, but with bullet holes and broken glass. If you want, you can use the Diffuse Map, or you can create a new damaged texture with the naming suffix "_DMG".
Select your model, then click the "Assign Material to Selection" button, and now your model should appear completely textured. If you have issues seeing the texture properly, try changing the "Technique" in the Material Editor - the default is set to high graphics quality. If you want to preview the team colour, check the box labeled "Preview House Colour Enable".
Congratulations! You've finished the tutorial! Now you're set to send the .Max file, plus your three texture files (or four, including the damaged texture) to either your animator, or to the modeler so they can prepare the rest of the model for importing into the game.
If you have any comments or (more likely) questions about this tutorial, you can PM me on ModDB, or send an email to email@example.com. If you don't get an answer right away, you can usually find useful answers at the Command & Conquer Forums, under the "Red Alert Maps and Modding" section.
Thanks for reading the tutorial! Happy modding!