|
|
|
How to Make Oval Sign with an Alpha Channel with comments by Paul DeVerterCopyright © 2004 Paul DeVerter, Tim Muir
This tutorial involves the use of Paint Shop Pro and TGATool2. It illustrates how to make signs that are other than rectangular, and using an alpha channel to obtain the final non-rectangular shape. Tim made some STOP sign and Speed Limit signs, which were oval and triangular shaped, and not rectangular. I wondered why they were not simply made using a geometric shape, instead of using an alpha channel. Then it dawned on me. If you are making a rectangular sign, then you could use the BOX tool in TSM to make the surface, and simply texture it with any old bmp or tga file. It would then have 6 polys: front, back, and 4 edges. You might be able to delete all but one, or two. But if the sign is oval, then the structure you make in TSM will have considerably more polys, in order to approximate an ellipse or oval shape. You can make an ellipse out of a tube, and move the points around, and delete surfaces, but you still end up with a number of polys in MSTS. And the ellipse is not very smooth. But if you use an alpha channel, you can make a simple rectangular sign, and use the alpha channel to give the effect of a very smooth curved oval or elliptical sign, and have only one poly per textured face. But, I was having great difficulty understanding how to make small odd shaped signs, and when I tried, I failed. What was really throwing me was how to create the “alpha” channel, and make an oval sign out of a rectangular poly. So, I ask Tim for help, and this is what he wrote. First, make a suitable shape in TSM. And since it will be two-sided, use the BOX tool to make the general sign shape. It will be rectangular, and the alpha channel will be used to make the viewable shape, such as oval or round, or whatever. The BOX should have the minimum number of polys, and when this is done, there will only be one on each face. Assume the BOX is 1’ wide, 0.6’ high, and make the depth only 0.01’. Then in poly mode, delete the top, bottom, and both edges, leaving only the front and back. Use F2 and pick an appropriate name for the sign, and also pick the material: TransNorm. Next, create the texture, and soon we pick up Tim’s instructions. Create, in Paint Shop Pro, a new canvas that is 512 x 512 or 256 x 256, with a white background. Then use the Floodfill tool to color the canvas an off-white, such as 253, 248, 237, to be used for the sign background and for a post or something to hold the sign up. Next, use the rectangular selection tool to select the left half or 2/3rds, and floodfill black. Then, use the elliptical selection tool to draw an oval or ellipse in the black area. Before you draw the ellipse, write down the coordinates of the center of the ellipse. Now, floodfill the ellipse with your off-white. So you now have a canvas that is black on the left, and the black contains an off-white oval. The right of the canvas is off-white.
Now, Tim’s instructions: 1. First thing I do is create a 512x512 map (size is optional) in PSP. You already know the procedure on creating the image for this exercise, so I'll continue at the point where I add text. I choose the font, size, kerning, etc, then type out the text. Note- I create as "Vector". This gives you the ability to drag the text around, and even stretch, compress and manipulate it to suit your needs.
Notice that Tim used a font called Empire Builder, which I do not have. But you can use whatever suits you. Eurostyle font is nice, and seems close to Empire Builder. You may have to play with the Kerning and Leading numbers to get it to look right. Likewise the Size, and the Stroke and Fill, and Bold or not. 2. Notice, in vector, the text has these little "grab boxes" in the corners and centers, and a rotation handle in the middle-right side of the big box. These nodes are where you grab with your mouse and move it around. The center one moves the whole text, while the others are used to stretch the text. Maybe you already know this... let’s continue... Once you text is centered in the oval, right-click the palette to remove the text-nodes (handles)........
3. For this exercise, lets not add any rust or other details, to keep it simple. Now, we have a basic speed sign. Lets save it to your TSM project folder that you are making the model. Save As: 20post.bmp ...then completely close out of PSP for now.
4. Now, open your TSM Projects/ your project folder and find the "20post.bmp" bitmap. OK, do you have your "20post.bmp" located? Now, right-click it and open it in TGATool2. You may get a flag that says it cannot open the file "tgatrns2.***", just click OK, and you'll get your bmp in TGATool2. Now, click File/Save and save it as a tga to your route. (See paragraph 9, below). Then click Export/Ace(-trans) 5. Now, open your Route folder and locate the new ace "20post.ace" and open it: On the right, click "Create Alpha Template", and you will get the little grayscale picture of the big map:
Next, right-click inside the little grayscale pic and "Send to Editor":
6. Now we come to the masking operation. Within PSP, with the select tool (marching ants) set on oval, find the center of the oval image as outlined below. Drag the selection out to cover the image, then flood-fill with pure white:
Click on the select tool and right-click the palette to remove the marching ants. Now set the selection tool to rectangle, and cover the right-hand side, which will be the post texture. Now, if you wrote down the coordinates, you can place the elliptical selection tool at those coordinates, and you should be able to expand (drag) the marching ants into exactly the right place. Otherwise you must calculate the average of the left and right sides to get the X dimension, and the average of the top and bottom edges to get the Y dimension. An alternative method, and what Tim is explaining, is to hold the cursor over the top center of the ellipse, and note the X coordinate. Then hold it over the extreme left center and note the Y coordinate. This will give you the X and Y coordinates of the center. All of these numbers are shown in the lower left of the status bar, as Tim has explained. 7. You are now left with the black transparent bit and white solid bit......... Just about done. Once all the solid areas are covered in white (255,255,255), click the save button, close PSP, and click on the Tgatool2 again (note that it is still active in the tool-bar). Right-click in the grayscale pic again, and choose "Reload After Edit", and it will look like this:
8. Now, click File/Save and save it to the route folder of your choice as a tga, then export there as ACE(-trans), and the rest as usual. Now go to the route folder and open the 20post.ace, and voila!- there you should have it! I attached it so you can see it for yourself. Go to Route Editor, install the sign, and you will see that it really works. I have included a photo showing a STOP sign on Tim’s layout, which is made the same way as illustrated. You may find it a little hard to see the sign in Route Editor, but look carefully – it will be above where the white “X” was.
9. Now you may wonder about having the tga file in the route texture folder, along with the ace. But this is where Tim stores his bmp and tga files too, so he can find them again if he needs to work on them. I, on the other hand, place all of my TSM project files in a series of subfolders located at C:\Projects\ Trainsim\SpeedSigns, or whatever. I even put the ace, s and sd files there too, and later move them to the Route when I want to see or install what I have. 10. If you have gotten this far, and everything worked out OK, then it is time for more details. Recall in Paragraph 3 that Tim omitted the addition of rust, and in the photo above you see there are also hangers, which are used to suspend the sign from a support pole or wire. Well, it is time to learn how to make the sign even better. We will first add some grommets at the top of the sign, then some hanger wires, and finally some rust and smudges. So the steps which follow should be done just after you finish paragraph 3 above, and then go back to paragraph 4 after you have added the rust, etc. 11. Here's some more on the tutorial.
First lets make the grommets for the hang-wires.
I used the grey Button from the Preset Shapes collection. Make sure you
check Retain Style and Create as a Vector.
You can also check Antialias, if you check it before checking Retain
Style. Place anywhere that makes
mechanical sense, noting the Y pixel position, here about 26 from the top. While
the Button is active with nodes, click on the Object Selector (the Object
Selector is the tool just below the Preset Shapes button) and then click on the
button/grommet and …..
........right-click/copy
/Paste New Vector Selection, which makes a copy of the button, and place
opposite the first grommet, being careful to keep the same Y coordinates.
12. Next, using the Draw tool, set on 3 Line Width, no antialias, to draw the hang-wires. Now, 1. Set the Magic Wand
tool to feather 2 pixels, and check antialias on. Click inside the oval. Next,
2. Set the airbrush tool around what the settings are below in the Tool Options
window. Shoot the selection a couple short bursts, to suit. Now let me interrupt to warn that if things are not going correctly, you
may need to make sure you are working on a single layer.
If you have more than one layer, they you will need to merge or flatten
them all together. Also the settings Tim gives are for working in 512 x 512 size
canvas, and will need to be adjusted for a smaller or larger canvas.
Also the photo below shows the Magic Wand with “antialias”, but I
could find no setting to do that. Notice
how the marquee is feathered just outside the oval, and also around the letters
or numerals too.
Shoot the middle of the
"0" following the same procedure as above. This means to remove the marquee (press CONTROL+D) and then again use
the Magic Wand to select inside the unpainted 0. If you have more than one such letter, simply hold down the
SHIFT key as you make further selections. 13. This is a basic background of rust. It could be left as is,
Or, further weathered with
streaks of rust/dirt, and/or spots and splotches of the same. Note the brush
shapes, sizes and Opacity settings.
This is pretty much it,
Paul. Not too involved, or complex. The choices of colors are purely subjective.
The alpha template would be a simple matter of drawing the white lines covering the hang-wires. Hope this will do for you. Let me know if you need any further help In conclusion, you have learned how to make signs or other objects, and how to generate an alpha channel. Using this technique, you could even use MS Paint for the drawing program, because the original artwork is simply a bmp file, and the tga and ace files are generated by the TGATool2 program and Train Sim Modeler. Paul DeVerter A Port City Car Co project paul@paradesquare.ca September 6, 2004 |