Bump Mapping in 3DSMax

Introduction

I have been experimenting with bump mapping in 3DSMax 9 – I had earlier used it with mixed results, and find the available help sometimes fragmented. Bump mapping is designed to give a 3-dimensional effect to a texture (using an applied RGB `Normal’ map), particularly brickwork, roofing iron, rivets on steam locos, and door outlines on the model for instance.

Basic information on bump mapping is on the Auran TrainzDev Wiki.

These are a few notes on some of the things to do in the process to make successful bump mapped assets in Trainz.

About Bump Mapping (Normal Mapping)

A ‘normal’ is a vector that points in the direction that a surface is facing (orthogonal to its surface). ‘Normal’ bump mapping applies ‘false’ normals to each pixel of a polygon, so that the reflection is not computed in accordance with the ‘real’ polygon surface, but according to the surface vectors of the normal map. This results in the bump mapping effect, giving the surface a 3D-appearance that is not ‘really’ geometrically there.

Normal maps may be created in Photoshop or Paint Shop Pro (PSP) using the NVidia Plugin filter. The plug-in generates the normal map by calculating the greyscale contrast. White is high, grey is flat, black is low. The plugin download site refers to Photoshop only, the plugin can be installed into PSP as well, and I will discuss use in reference to PSP. Note that for Photoshop you are required to convert the original texture to a greyscale, while PSP can only operate on the full color image. In PSP the downloaded file is placed in the plugin directory – you may have to create the directory first in the PSP program installed files. The plugin will then show in PSP for selection.

NVidia Plugin Download

An example bump map courtesy of the Trainz site shows the bump image created with the filter.

Creating the Bump Map

The example image below is part of a texture I used for the GG20B locomotive. If you use layers in PSP, you need to merge them all together before applying the filter.

Note that particular attention is paid to detailing the vents in the body, make dark lines below a vent slot and light lines above. This will then have the correct raised or sunken appearance in the final map. Mapping the texture upside down on the model will reverse the effect and appear “back to front”, hollow where it is supposed to be raised for instance.

The normal map is created using the filter.

   

Select the texture  image then apply the filter from the Effects drop down menu.

Use the selections shown in red in the pop-up menu then click OK.

In the bump map you can see how the final effect might look, with the light green areas being highlights on the model. Normally you do not edit the bump map, if it looks wrong go back to the original texture and make adjustments.

The TrainzDev Wiki lists some important information:

  •  Once the bump map has been converted to a RGB Normal Map, do not apply any changes to it like scale, blur sharpen etc. If you wish to alter the normal, apply the changes to the greyscale height map (full colour map in PSP) then re-generate;
  •  The normal map does not have to be the same dimensions as the diffuse map. Normal maps can be smaller to save texture space, larger for finer grain bumps but the later is not advisable at 1024x512. As above, do not apply changes to an already generated normal map;
  •  Use only uncompressed 24 bit tga’s;
  •  Don’t stretch your mapping co-ordinates. You can get some seriously undesirable effects.

 Sometimes there are parts of the original that do not require the bump effect, like painted on lettering, and you do need to edit the normal map to correct the result, just copy an area of uniform blue over the effected parts – you can see the result of the filter on the Amtrak name for a second GG20 model. Alternatively, delete the lettering from a second copy of the main texture and generate a bump map to suit (if you have the lettering on a separate layer in PSP you can hide the layer when making the bump map file) . Use the copy with the lettering as the main diffuse texture in 3DSMax

 In the center you can see how the Amtrak name really stands out, and would look unrealistic on the model. The far right shows how the even blue colour has been copied over the bump map Amtrak name so the lettering will be flat on the body. For this reason, photographs do not make good bump map images, the varying shades make a surface look like it is covered in rust scale in the finished model, unless you even them out. Of course you can add a layer of dirt to an original texture after you make the bump map, and this should blend well – just make sure you keep backup copies.

Loading the Files into 3DSMax 9

Give the bump map a name such as bump_amtrak.tga for instance and load the textures into 3dsmax. Select an empty Material slot  in 3DSMax and use the special name for the material, with the .m.tbumptex extension, such as body1.m.tbumptex, see the image below.

Load the diffuse texture and the new bumpmap in the map slots shown. Make the Amount 100 for the bumpmap value, if the effect is too strong, reduce it later – you are trying to see some effect in Trainz, so the high value should make it stand out.

Again, give the correct material name to the top level name box for each of the loaded slots (body1.m.tbumptex) – this makes it easy to recognize the material when selecting later for mapping. Don’t forget to click the blue checkered box in the menu to make the material visible, after it has been placed on the mesh.

In the next image:

  • click on the Ambient colour swatch, the Color Selector opens, drag the pointer down to the bottom, to set the colour to white as shown.
  • click on the Specular swatch, again drag the pointer so the colour is about 150, 150, 150.
  • set the Specular Level to 100 and the Glossiness to 32.

These setting are needed only for exporting the bump mapped material on the model correctly. For other standard textures, do not change the default values or the exported texture will glow or show the wrong colours, particularly from the Specular level of 32.

Exporting

When you have finished mapping the model, export it to Trainz. Make sure the “Use default material colors” is un-ticked in the export box (have it ticked for the export of all other material types).

You should now have a model in Trainz showing a better texture detail, of course you can experiment with the settings and original texture until you are satisfied. Leave the Glossiness at 32 to match the game settings.

In the maps drop down, for the tbumptex material type, you could add Reflection and Opacity maps for other effects. The opacity map can be made to vary the specular in different parts of the model texture, so you can have a shiny roof but flat parts elsewhere.

Refer to the TrainzDev Wiki for additional information.

This is the bogey texture for the GG20B locomotive, with bump mapping:

The bogey combines a detailed mesh with the bump mapped texture to show good detail, the bolts on the bearings and plates are only bump mapped:

Negative Images

Sometimes the bump map will make the object seem to be recessed instead of standing out from the surface, because the light and dark shading, particularly in a photographic texture might be in the wrong place, dark on the top, light on the bottom for instance.

This is good for brickwork, where a darker mortar line would be recessed. For something like door handles that would be proud of the surface, they look incorrect if appearing recessed. The answer can be a negative mapping process – take the original texture, and convert it to a Negative image (in PSP use the Image… Negative Image option). Now make the bump map, and the detail will seem to be recessed, but this will make the final image proud of the surface.

Here is a picture of a coiled rope I used on the side of my tugboat model, the left shows the original bump map, and the recessed result, the right shows the bump map produced from a negative of the texture, and the resulting rope seeming to be raised from the surface.

Vulcan April 2012