August 23rd, 2007
A visitor to the Train-Sim forum asked a question about
texturing in TSM. I found myself wishing that I could just toss something
together real quick, but the truth is it's a little hard to write out, because
it takes so long to learn all the little tricks and nuances. Then it occured to
me that the new home of KelticSylk.com was exactly the place for such a thing.
Because everything I need to create such a document is close at hand, it should
be pretty easy to write an article (or series of articles) on how we do things
here at the Agony Eastern shops...
When I do locomotives, it gets really tricky because I usually have to play
around between several programs to get what I want. Especially if there are
stripes involved or two tone paint schemes. This is mostly due to the rather
bizarre techniques I tend to use.
Buildings on the other hand are entirely different. On my first structures, I
actually tried to draw a seperate texture for each side of the building. It was
cool in some ways, but very limiting in others. Then I discovered "tiling". On
my newer buildings I use small textures to color the sides and tile them across
the building. All the other details are seperate parts. Some of my earlier
buildings are done in a similar fashion, but I the tiles I used were entire
walls...
Lets say you're making a brick building. I'll use "Logan House" as an example...


The main structure is textured in a 1024x1024 texture of windows and several courses of brick. The brick textute needs to be "ubiquitous". Aside from always wanting to use that word in a sentence, the idea is to make it so generic that looks pretty much the same at all edges. For instance, you don't want any one edge to be darker than the others. They all have to be pretty much the same shade and color. If you don't do this the "tiling" will have a pattern to it that will be easily visible on the finished model. The way I usually accomplish this is to mirror the left side of the texture with the right side. This gives the texture an even look and decreases the chance you'll end up with stripes on your building sides.

I then apply these tiles to the building side. I suppose there is a formula or something you can use to determine how many tiles in x and y direction, but I always fudge it. I play with the tiling numbers until it looks right. The only numbers I use are an estimate of how big an actual brick is (about 8" long, 2" high, and 4" deep) and how it should look if I were really laying brick.
The tiling shown here is for the front of one of the two wings of the hotel. I created the texture so that it's height is correct for a four storey building. So there is only 1 tile in the vertical, or "Y" direction. The width however is not quite wide enough for the area. This is because the texture MUST be square to work in MSTS. So I have to use 1.2 tiles horizontally, in the "X" direction.
As I mentioned earlier, the texture is made so that the bricks will be a
realistic size when seen on the finished model. The bricks are scaled relative
to the windows. I try to make the window a realistic size, roughly about 28"
wide x 30" high. This works out to be 3.5 bricks wide x 15 bricks high. I try
not to make the bricks oversize. It can really affect the final appearance of
the structure in the sim.
The
Logan House wall texture was made by taking a single course of brick and pasting it
over and over again to create an entire wall. I then pasted pictures of windows
at regular intervals over the brick on a different layer until I had a wall with
windows. That wall with windows was then applied to the model as a tile. A large
one, but a tile nonetheless.
You may be wondering why I bothered with the 4" depth of the bricks. After
all who cares how deep they are? That's inside the wall!. That would be true if
buildings didn't have to change direction and turn corners. At corners the depth
of the brick is very obvious. The way brick is layed actually takes this into
account when creating corners. It is one of the reasons that each dimension of a
brick is a function of the other two sides. Half of 8" is 4". Half of 4" is 2".
The reason for this "arithmetic" becomes very obvious when viewed from a corner. Remember that each brick is usually centered under the joints of the two bricks above it and the two below. This allows the bricks to interlock and makes for a very strong stucture. You might be wondering, "How does he get most of the bricks to line up at the corners?". In this case it's a result of the texture itself. Remember the texture is the same "height" as the building. The bricks should fall together like that. You can see that it's not perfect, but pretty convincing.
I used the same technique when texturing the shingle on the roof. the shingle texture is a 512x512 picture of some shingles, tiled in X and Y to look like the real thing. The technique for the roof sections is a little different from the walls in that I used more tiles in both directions. IT looks pretty good to the left. On the ride side I didn't use enough tiles along the X axis and the "shingles" look a little too wide.
Logan House has a lot of windows, so I found I couldn't use smaller brick tiles and make the windows separate parts. Back then we didn't have Shape Fixer so I had to rework the model manually to get it into the sim. The way to do that was to make the windows part of the texture. On some later models, however, I didn't bother with drawing the whole side. The model is actually done the same way the roof shown here was done. Smaller textures, more tiles...

The best example of this is a model of the Western & Atlantic train shed and depot in Atlanta used in the W&A project route. For this model all the doors and widows are separate parts. The brickwork is actually dozens of tiles made up of 512x512 pictures of bricks...

Once again, the picture was "mirrored" right to left so the shade and color would be more even in appearance.
On the Atlanta models I had to use trial and
error to "lay" the brick work. Rather than using something like 1 x 1.5 as on
Logan House, both the depot and the roundhouse were more like 40 x 250 or
whatever number it took to line up the bricks and keep them looking "to scale".
When
your using tiles on a rectangular building the "Y" factor stays the same for all
sides. If, however, one of the sides is taller that the rest, tile the tall side
first and get it set the way you want it. use the same number of "Y" tiles on
the other sides. TSM will use the height of the tallest part to set the "scale"
of the tiles. if you use a different Y factor your bricks will be oversize on
the shorter sides. Keep in mind that this is only true if all the side are on
the same part. If some sides (or all of them) are separate parts you will need
to determine the Y factor for each part. On the Atlanta depot all the interior
buildings are rectangular and about the same height. The Y factor on all side is
the same. On the shed the ends are taller than the sides, and I had to use the
tiling factor of the ends to texture the sides.

One other odd thing on the Atlanta project was the fact that it was truly 3D.
Rather than use transparencies to make the archways on the sides, I actually
built 3 dimensional parts. In those areas the X factor got a tad weird. In some
cases I had to use decimal places for the horizontal tiles because I needed
fewer bricks than are contained in the texture. The tiling on a column, for
example, might be something like X=3 Y=50.

What about all those archways? Creating arches in TSM is
not really possible. There are a couple of reasons but it basically boils down
to using the point and poly functions to create what you need.
Unlike
other programs, including Sketchup, TSM does have those "boolean" functions
where you can subtract one shape from another. What you can do is use two shapes
and combine them (Join Selected), then use the points of the combine objects to
create the arch.
The easiest way to make an arch is to use the cylinder tool to create a clyinder
without ends. Erase half the cylinder and you have the lining of your arch. You
will have to reverse all the polys so that they face the center of the cylinder.
The rest of the arch, be it a bridge or a wall is created from a rectangle. The
polys don't really matter, because what you really need is the points for the
corners. To create the "face" of the arched wall you will need to create polys
using the points from the parts you combined.
If you try to make the face of the arch using one poly, you will find that TSM
will screw up some of arch curves in the front or rear face. It has this quirk
where it doesn't always like turns tighter than a certain degree. The poly may
try to take a short cut to the next point and the curve on the face will not
match the curve of the lining. What you have to do in such a case is to erase
the offending poly and create two or more in it's place. What I do in such a
case is to make all the polys for the face manually. I use a series of triangles
made using one point on the outer edge of the wall face and two adjacent points
from the arch curve. The end and side walls of the Atlanta train shed are made
in this fashion.
The upper end walls show you the kind of gyrations you need to go through to get some of the openings and arches to work in TSM. I'm sure it would be easier in other programs, even a "simple one" like Sketchup.


The Atlanta roundhouse was done the same way. In this view you can easily see the way the arches, the walls and the arch linings were made.
It sounds like a ton of work. It is. It uses the simplest form of 3D modeling, points and polys. My personal opinion is that this simplicity makes it very powerful. I don't believe I could have acheived the shapes of many of my locomotives in any other fashion.

Unfortunately, the Atlanta models themselves are so complex they required assembly in the Route Editor (Shape Fixer wasn't available at the time), and were absolute killers on framerates. I wouldn't do that again in a million years. These texturing techniques, however, worked out pretty well and I still use them for structures.
Well I think that's about it for now...Thanks for listening.