Monday, October 22, 2012

3DC to Railworks - Locomotive: Paint Your Wagon Part 1

3DC to Railworks - Locomotive: Paint Your Wagon Part 1
by Jerry "SMMDigital" Conaway


< PreviousIndexNext >


Everything that we have done so far is important in the grand scheme of getting a locomotive in Railworks, but texturing the model is more important than most other aspects. A good paint job can mean the difference between a professional looking model and one that looks as if it belongs in MSTS. It takes a bit of in-born artistry and a lot of patience to digitally paint a locomotive - and both of those qualities I'm in short supply of. Thank goodness for people who like to repaint things!

In this tutorial section, I will cover how to get a rudimentary coat of paint on the locomotive that we have been working on. As I stated, I'm no Picasso, so the way I do it may be much less than what would be required by a professional artist. But hopefully we will be getting something presentable into the game.

Before we get too deeply involved in painting, I'm going to throw out a few terms and definitions that you will be seeing over and over throughout this section:

Alpha Channel: This is a sort of "Layer" that is applied over a diffuse texture to give the parts it is painted to transparency. For example, instead of using 3DC to cut holes in the mounting steps of a locomotive, you can place an alpha channel over the step "paint" on the Diffuse texture and the holes will be painted on the step. The alpha channel on the image at left is shown in red.

Another use for Alpha is to enable varying degrees of shine on a locomotive. The difference between whether the Alpha channel will be see-through or shiny depends on the Shader that is used on the part in 3DC. It should be noted that you cannot have both a transparent alpha channel and a shine regulating one on the same Diffuse texture. That means that two different textures must be used; one that contains paint for shiny parts, and one that contains paint for see-through parts.

Imaging Program: The computer based program that you will be using to edit textures that will be applied to your locomotive. I would have to say that the best out of all I have tried is Photoshop, and I will be using Photoshop 7 to make my textures. However, any imaging program that is able to create Layers, Alpha Channels, and save the output to Targa or Ace files will be sufficient for this project.


Layer: Any good imaging program worth it's salt will be able to create images using layers. Basically, this gives you multiple canvases to draw on using only one texture. For instance, you could draw a door as one layer, add another layer on top of it and draw a knob, then add another layer on that and draw graffiti. The advantage is that if you mess up the graffiti, you don't have to erase and start over the entire door. You simply erase the graffiti or delete the graffiti layer and redraw it.

The ACE image format that Railworks uses does not require layering, so layers must be merged before the ACE file is exported.

Map: This is a fancy way of saying "Texture". To break it down even further, we will be using several different kinds of Maps on our model:


Diffuse Map: This is the main texture, the one that you paint all of your locomotive colors, doors, features, and whatever else will be seen on the locomotive. This map will go into the first texture slot.

Normal Map: Not to be confused with a Bump Map, a Normal map is a grayscale image that is overlain in 3DC on the Diffuse map to bring out features such as nuts, bolts, rivets, and welds. The Normal Map combines with lighting in the game to give any area that it is applied upon a raised or sunken appearance. This map is applied to the fourth texture slot in 3DC.

Normal maps such as the one shown can be made using a special export plug that works for most versions of Photoshop.


Specular Map: In other programs, this is used to bring out areas of light and dark on the model. I don't know much about how to apply this map in 3DC, so we will not be using it. If I figure it out later, I will revisit the issue.


Environment Map: This texture is a "switch" that is used to enable shine on a surface in the game. This texture can consist of almost anything - a grayscale pic of your Diffuse texture, a blank dummy texture, or even a picture of your junk - as it will be replaced in the game by environmental reflections. This map goes into the 6th slot.

Shader: These are switch commands that turn on or off a particular texturing effect in the game. We will be using the following on our locomotive model:

- TrainBasicObjectDiffuse.fx : This is a basic material shader for parts that require no special effects in the game. The old Railsimulator equivalent was TexDiff.

- TrainBumpSpecEnvMask.fx : This shader is required in order to use a Normal, Specular, or Environmental map. Using this Shader also requires an Alpha Channel on the diffuse texture. You can vary the percentage of white in the Alpha channel to regulate how much shine you get on the model.

- TrainGlass.fx : Enables an object to have both transparency and glossiness so that it can be used for windows.

- TrainDecal.fx : Gives decals or any object with writing a smoother in-game appearance.

- TrainEmissiveGlow.fx : Lights up to full bright with "fuzzy halo" any object to which it is applied. It also requires a blank texture in the second 3DC material slot in order to regulate the color of the light.

- Tex : Any part that this shader is applied to will glow brightly at night.

These effects are applied in 3DC through the user-created Custom Material fields.


UnWrapping : The method by which you will create a template to paint the parts of your locomotive. 3DC does a pretty lousy job of it, so this will be a time consuming process.

282. Lets dive right in and get this done. Start by choosing a part of your model, right click, and choose "Show Only".

Something I need to mention here is that instead of scaling the unwrap like was done in the Alex tutorial, I will be "Freehanding" the part, meaning I will not be choosing a scale. I did this because the unwrapping operation would not let me move the parts around on the texture map in the way that I needed. I only did this for the main locomotive body parts and used scaling on all the other parts.

283. Now that we have the single part that we want to work with, select a face on the part ("3", click on face). Then, under the "Shape Operations" tab, click on the "UVUnwrap" button (second button from the left). If you are not using "Edit Face Coordinates", then you will be given a warning about it. Cancel your unwrap session and correct the problem, then start over .

284. The Unwrap window pops up. The right side of the window is the editor. Here, you can scale and rotate your map into it's desired position. The left side is the preview window, which will be important in making sure your wraps are scaled properly and distortion free. Since this is the first time that you are using Unwrap on this model, a small field will appear where you can choose the size of your texture template. You should choose the largest size available, however, this may be limited by your screen resolution. On my main computer, I can choose 1024x1024, but on my laptop, 512x512 is the largest accepted size.

285. Because I am not using any sort of scaling on this unwrap, all of my parts start out filling the entire texture. I use the Scaling buttons (the two above the "OK" button), to reduce the size of the wrap, the Rotate buttons (above the "Cancel" button), and then manually drag on the points by clicking them to further reduce and position the size of the wrap. The Coordinates located below the editor window will tell you where the points are on the texture. You should try to be sure that you checkerboard pattern on the model that is shown in the preview window is fairly free from distortion.



286. Once you are satisfied with the positioning, click OK. You will be asked to save your new texture. I would save it as a name that is related to your locomotive project, one that is easy to remember.

287. Back in 3DC, select the top and use the same procedures to begin the unwrapping operation.

288. Rescale, rotate, and position each corner point by dragging until the top matches up to the side of the locomotive that you previously unwrapped. Think about the fact that we are trying to lay this locomotive out flat for painting, much the same way you would lay a blanket on the ground. Use the preview pane to make sure everything matches up.

289. Select the last side to be unwrapped and do it the same way as the other side and top. When you are finished, you will have a template that is flat on the texture, and will enable you to paint both sides of the locomotive and it's top in a continuous texture, if the scaling is not to badly off.


290. Most locomotive bodies are one or two piece shell that can be unwrapped fairly easily. However, on this locomotive GE seemed to be going for some kind of gimped-up art deco look, so the long hood has three distinct sections. We just unwrapped the section that holds the dynamic brake grids, and now we will unwrap the engine section. This time we will start out by selecting the top, curved sections and all.

291. The wrap is not to scale, so it takes up the entire texture. We scale it down to a smaller size, then rotate it.


293. Once we have the wrap near where we want it to be on the texture, we will have to manually move all points into position. With this many points, it take a bit of patience, as well as paying attention to your Coordinates information.




294. Next, select and Unwrap the sides of the small hood.

295. Scale, rotate, and place making a continuous map as if we were looking down at the top of the locomotive.

296. Select the other side and unwrap it.




297. Now unwrap the radiator hood, starting with the top...





298. ... and both of the sides of the hood.



299. When you are finished unwrapping the hoods, your template should look something like this. We have taken a 3D object and lain it flat out, like a picnic blanket on a lawn.

300. Basically, the method that we just used is what you will doing to unwrap the rest of the model - select, Unwrap button, scale, and position. On the rest of the parts I used the scaling method described in the Alex tutorial to place other locomotive parts on the texture sheet.











301. One caveat to Unwrapping in 3DC (at least in the version I'm using) is that it will not produce a planar cylinder unwrap. If you try to select all of the sides of a cylinder and run the Unwrap operation, the cylinder will unwrap as a cylinder, with faces both in front and behind each other. The best way to paint a cylinder is to create your own flat textures and paint it on manually. But, if you insist on making a template for the object, then selecting each face individually, Unwrapping it, and placing it manually on the texture template is the way to go.

Start out by selecting the first face you want to Unwrap and place it on the template.


302. Then select the second face and unwrap it as well, placing the result next to the previous face on the template.


303. Continue unwrapping this way until all faces in the texture are placed on the template sheet.




After UnWrapping, I came up with six different templates for the complete locomotive and cab. You will notice that the templates are incomplete, simply because there are some parts that I choose to hand draw instead of unwrap, such as the locomotive deck, radiators, and such. The first three templates belong to the exterior locomotive model. One and two contain sections that will receive an alpha channel for parts that will reflect light in the game. The third texture is for parts that will have see-through cut outs.



Templates 4, 5, and 6 belong to the locomotive cabview. You will notice that the parts are more tightly packed together than the first three. This is because I unwrapped each part to it's own template and then used my imaging program to cut, past, and arrange them on the main template. This makes more efficient use of texture space and will be standard procedure for all future unwrapping projects.





< PreviousIndexNext >


Published with permission from Jerry Conaway, 2012

No comments:

Post a Comment