Auran Web Link
Ianz Trainz

 
line

Home Page
Site Map
About
Downloads
Projects
Tutorials
Tutorial Introduction Transparent Windows Tutorials Making Art Files Scenery Backdrops Vehicle Modeling Stereo Pictures Settings in Gmax Animated Windmill Mapping Textures Shadows on Scenery Models Next Button Links
email

Tutorial 3: Making Scenery Backdrops for Trainz from Pictures

Background

Backdrops for Trainz are not that difficult to make, and can be useful on the edge of a baseboard. The backdrops should fit into a baseboard length, which is 720 metres (72 grid squares of 10 metres). A good size for a small backdrop is 180 metres, four to a baseboard length. It is possible to make a backdrop the full length of the baseboard (720 metres). This reduces the number of backdrops to be placed, but may stretch your texture files for some loss in quality. Consider a balance between the backdrop length covered, the texture quality, and the file sizes.

Pictures

The first requirement is to be able to get good pictures without other objects getting in the way. You should of course own copyright on any pictures you use. A 3 km walk along the river gave me enough pictures for my recently uploaded Brisbane River series. Taking pictures across the river eliminated any foreground objects.

River Backdrops

Take pictures at right angles to the scene, not panned, or the ground line will run up on a slope. Use a picture size of 640 by 480 or greater, with some overlap, say 20%, this allows you to merge them, but also lets you see which shots will join, when you have many similar shots to sort through. Try not to change the zoom of the camera, so you take pictures the same distance from the objects, otherwise you complicate the scaling of different pictures to join.

If pictures are too large and have to be reduced, in Paint Shop Pro, when resizing, use the bi cubic resample option from the menu. This gives good quality in the smaller image, Smartsize is not as good.

Template

We need to be able to paste the individual pictures into a larger template so we can move and rotate as necessary, and merge the pictures at the edges. The aim is to make a very long strip of pictures and later to cut it into shorter lengths to suit each backdrop, for our example, 180 metres long. Of course the backdrop should generally be made to real scale, so work out the actual size of a building in your picture for example and estimate how many pixels per metres will suit your images.

For the 12 River backdrops example I made a blank file say 15000 by 480 pixels, (original pictures were 640 by 480) and pasted the pictures in order, merging the overlaps and touching up as necessary so you have no joins. A texture size of 1024 by 256 is to be used for good detail, so a template 15000 pixels long is enough for the 12 backdrops at 1024 pixels each, allowing some spare space to maneuver and copy images.

Placing and Merging Pictures

You can see how two 640 by 480 images are placed in the template, and need to be merged, note the overlap in the original picture, which helps merging and also identifying which are adjacent pictures in a large selection.

Merging Pictures

Slide the right hand picture to overlap the one on the left, match at the junction vertically and horizontally, and then edit the image, to blend the colors at the merge line. You do not have to match the sky as this will be cut out later, as will some of the water to reduce the height of the image to 256 pixels. Use the clone, copy and paste tools in your picture editor, to blend the picture junctions. Hopefully the colors in your pictures will not be too different (note the slight difference in water colors below) or you will have to try to match and blur the junction colors. It is useful to copy and paste trees for instance, over the join.

You could use different layers when placing the separate pictures, it allows you to delete detail in separate layers, but they would have to be merged into one layer (flattened) so you can blend the joins using a clone tool.

Joined and Blended

Cropping the Picture Height

After you have joined all the pictures in the template, we need to make sure the height will be 256 pixels (for this example). Find the highest object in your picture, and decide how much of the foreground and sky can be thrown away, and crop the image you want to a height of 256 pixels if possible - otherwise crop larger and you will have to reduce (rescale) the height to 256, try not to lose detail. If you do resize, remember we need the template length of 12288 pixels or greater to make the 12 backdrop images.

The image below is only part of the template and is cropped to 256 pixels high. Notice how the water colors in the picture above have been successfully blended using the clone tool.

Cropping Height

Seamless Backdrops

When you have placed all the pictures in the strip, and have joined and matched them, you should consider if you would like the ends of the strip to wrap (so all the backdrops can be placed and joined repeatedly to make a continuous length, longer than the original twelve). If so, you will need to make the edge at pixel 0 match the edge at pixel 12288 (remember 12 backdrops by 1024 = 12288 pixels).

While the backdrops will be seamless at the joins between the pictures we use, they will not match at each end. If you want the pictures to be continuous, copy part of the image from the left end to the right end, then blend it into the main image, so backdrop 1 and 12 will join nicely. See the steps in the image below:


Seamless Pictures

Use the clone tool to blend the join line which is located 12288 pixels from the left of the picture. In the After image, the water and the trees have been blended to merge.

Blending Joins

Now choose the dotted area in the After picture, the same size as the original area you copied, starting at the 12288 pixel line. Copy it back to the start of the picture strip.

Crop the end of the template image at 12288 pixels where the join line was (to enable us to make 12 panels of 1024). Your strip is now seamless, and the left hand end will join to the right hand end, i.e. Backdrop 12 will now joint to Backdrop1.

Making the Sky Transparent

Delete all the blue sky from the image to make it transparent, or at least a uniform but different color form any of the trees or buildings in your picture. This is so you can easily choose the sky area later. Cropping around trees is a bit of work. You may use a number of tools to rub out or to select and delete. Try to leave as much fine detail as possible around tree leaves, and take your time. You may need to delete areas inside the trees, to make these transparent, remember to select all these areas when making the transparent opacity layer later.

In the picture you can see the effect after merging all the pictures and cutting the sky, which in this example is white for the time being. This is part of the longer template, showing two joining panels.


Picture Strip

If you leave the sky area white in the main texture image, when you use an opacity map to make it transparent in gmax and Trainz, there will be a milky halo around all the tree leaves, very unrealistic. It is caused by the white and the green leaves bleeding at the interface.

Choose a green color for the fill tool that is very close to the color of the trees, but not so close that you cannot select all of the sky later, without getting the trees in the selection. After selecting the white sky, fill it with this green color. Try to select the green sky area again, and see if you get any trees or buildings added to the selection. If so, undo all the steps back to the white sky, and choose a different shade of green and repeat the fill, until you can select the green sky only.

This will eliminate the milky color bleed at the tree/sky interface. Remember to save the template and backup copies as you progress.

Make another layer in your template for the opacity, select the green sky area in the base layer (shown white above, but now filled green), change to the opacity layer above and then fill this equivalent area black. Invert the selection, which will select the area behind the main colored image (building and trees) and fill it white. Make sure the colors are pure white and black - see later.

Opacity Layer
This image can be saved as a .bmp file and used as the opacity map in gmax. It will “cut out” the sky area to make it transparent in Trainz.

A better and more efficient way is to use this image as the alpha channel of the original colored template tga file. We will look at that later.

Cutting the Template into Backdrop Lengths

The base layer of the image is the colored texture for the tga file, and the second layer is the black and white image for the opacity .bmp file. We can save these separately but we really should combine the opacity file into the alpha channel of the tga. See other tutorials on how to make an alpha channel in an image, Photoshop is easier than Paint Shop Pro. Do this before cutting the image into backdrop lengths.

Starting on the left, select a section of the template 1024 by 256 pixels and crop it out. This is your image and opacity for panel 1 (two layers in your image). You can save the base layer texture as the tga file, and the second layer black and white opacity as the bmp file as above, if you have created the alpha channel, the tga image will have the alpha channel embedded.

After making the files, Undo the crop action, you have your 12288 by 256 image back, so crop the next panel from 1024 pixels to 2048 pixels horizontally and make panel 2. Repeat in this way for the 12 panels. These will be your textures and opacity for each backdrop, make sure they are all saved with unique names.

Comments on the Opacity Map

You may wish to use backdrop planes near each other in Trainz, say a backdrop with buildings at the rear, and one with low trees in front, both using opacity to “cut out” the sky. Alternatively, you might like to have a day backdrop and make another backdrop plane a short distance in front, for a night model.

The original Trainz supported opacity maps of two colors, black and white. Since TRS2004, these colors have been interpreted differently. Unless you add at least one extra pixel of a color other than black and white in the opacity map, fine details like catenary, railings and ropes in models will fade out and flicker at a short viewing distance from the model. It is usual to add one or more pixels of a dark grey in the black area to correct this issue.

However, for backdrops do not do this. Use only black and white in the opacity map or alpha channel. If a third color is used, you will find that backdrop layers placed in front of each other will suffer from the alpha sorting issue, where a plane at the rear will appear wrongly in front of other planes.

Use only black and white in the opacity map or alpha channel.

Comments on Backdrops Size

A longer backdrop of 720 metres is quite effective and easy to place in Trainz. Good quality can be achieved if you use an image size of 2048 by 512. Trainz will support this size, but do not go larger. If you use a 4 to 1 size ratio, the height of the backdrop will be 180 metres, sufficient for tall buildings. Remember, large image sizes effect the performance, and multiple images for opacity or night planes really make an impact.

Gmax

Now we have all the textures of the right size to make backdrops, make a plane in gmax of 180 metres by 45 metres high (4 to 1 ratio). Make the left corner exactly on the origin, so it rotates about that corner in Trainz, and the plane sits on the ground line. Place the texture tga file in the diffuse color slot, and the opacity bmp file in the Opacity slot in gmax (if the alpha channel is not included in the tga file). If using the alpha channel for opacity, place the tga file in both the Diffuse and the Opacity slots.

You might want to select “2 sided”. A two sided backdrop is useful so you can see it from the back, and reverse the direction of placement in Trainz, but be aware of any reversed names appearing on the rear side.

Once you have a backdrop plane in gmax, and a texture is mapped correctly, you can place alternative textures for the other joining backdrops and export separate models.

Night Backdrops

Night backdrops can be very effective for city building backdrops.

Night-lights can be added in a couple of ways. You can make a backdrop plane for the night model, the same size as the day plane, with a large texture. This is quite wasteful if there are only a very few windows to light up, and very likely will require an extra opacity map file or an Alpha channel. You can clone the day backdrop plane, and move it 1 metre to the front in gmax. After correct night texturing, this will be your night model. You could make this backdrop, from the day plane, you could pick out all the windows on the buildings in the original colors, or texture them white or yellow, then paint the rest of the buildings black. Of course the alpha map or channel will cut out the sky shape as before.

TRS2006 Backdrop

Alternatively, you might like to create small white\yellow planes aligned over building windows in the day plane, to match the main day backdrop. The night backdrop will now be a number of very small planes, not one large plane. A small texture file (single sided) is used, it adds polys to the model, but the file can be very small for the light or window color, without an opacity file or alpha channel required.

For either method, make the texture single sided, with the normals facing away from the day backdrop plane.

In normal scenery models, you should place a night model a little way off the main day model, this stops the planes flickering. For example, windows for a small house may be placed 0.05m (50mm) off the wall surface. Because backdrops will be seen from a large distance, the night model must be placed a larger distance, perhaps up to 1 metre or more, off the main plane (to stop flickering).

Export the planes for the night model to the nightwindow directory, and reference the model from the mesh table. Make sure you use the nightmode home or nightmode lamp tag in the main container for the asset (see below).

If your backdrop is 2 sided, (to be seen from the rear as well) you need to clone the night plane or planes and place –1 metre behind the day backdrop plane, and reverse the normals so they point correctly to the rear. You will end up with a day backdrop, and two planes either side of it as the night model.

Effects

If you have buildings with chimneys on your backdrop you can add an attachment point for a smoke emitter, or flashing corona. Again, this should be placed about a metre or two in front of the backdrop, there is a wind effect in Trainz, and if placed on the backdrop plane, the wind may blow the smoke to the rear of the backdrop and it will not be seen, if it is not in the transparent sky area.

Config.txt file Editing

When a model is exported, a texture.txt file is created for each texture combination. It automatically adds a line in the file to tile textures, for example:

Tile=st

This allows a texture to repeat (tile) at the edges, and for a single tile makes the edges bleed color from the bottom to the top. This can show as a phantom white line in the sky at the top edge. Note also the milky edges to the trees, (corrections mentioned above).

Phantom Line

Change this line to be:

Tile=none

This will stop the tiling action and remove the line. Be aware, every time you re-export the model, this file will change back to Tile=st. You need to manually change it after each export.

In TRS2004, config.txt files and the texture.txt files are easily found in the Custom directory. In TRS2006, you will have to open the model asset on Explorer, find the created directory, edit the file as above, save the file and commit the asset.

TRS2006 Options

The new Trainz version adds a tag that recognizes a model as a backdrop:

backdrop 1

This tells Trainz to display the model at all viewing distances, it does not turn the backdrop off as you back away from it. This is good for seeing a city from a large distance, but be aware that the ground and scenery in front of the backdrop will be culled (vanish) according to the draw distance settings in Surveyor or Driver. This can leave a large blue hole on the ground in front of the backdrop. You should construct your scenery with this in mind, to minimize the effect.

Add the height adjustment tag, so you can vary the height to suit the terrain, say:

height-range -100,100

Try the new example backdrop models in TRS2006 to see how effective the night lights can be for the Towers backdrops, and the smoke for the Tidewater backdrops.

Other textures

The rolling hills example backdrops in TRS2006 have been made by making and texturing a terrain in Trainz, and taking screenshots of the results. These images are processed as in this tutorial. Use the trees and textures in Trainz for the screenshots and it will be easy to later match those colors and objects when you texture and terra form around your backdrops in Surveyor.

Placing Backdrops in Surveyor

Because the origin was created at the left end of the backdrop plane it is quite easy to drag this point to the edge or corner of a baseboard, and rotate it to align closely with the edge. In Surveyor you will find it easier if you look down on the selection point when placing. The backdrop will “snap and lock” to the edge, so you need to pull it off and re-adjust if you wish to slide it along the edge. Adjust the height of each backdrop to suit the terrain, and to match adjacent joining backdrops.

Placing Backdrops

Butt the other joining backdrops up closely to any placed ones, making sure they touch exactly at the join, and adjust the height to suit. Look vertically down on the backdrops to see that they are aligned exactly on the baseboard edge. Aligning backdrops when placed away from the edge is a little more difficult.

Ian Manion (Vulcan) September 2005

Amendment Notes and Comments

4/09/05 Initial version.