Trainz/Polished metal using Blender

From Wikibooks, open books for an open world
< Trainz
Jump to navigation Jump to search

Technically this has been done. One creator who has done this suggests the following tutorial as a starting point.

m.tbumpenv and m.tbumpgloss seem to be the key for TS2010.

rumour3 comments

From my experiments tbumpenv with a black alpha-channel in the diffuse texture appears to be visually the same as tbumptex. Changing from one to the other in Blender was as simple as changing the material name and then editing the textures and .txt files by hand. Progressively lighter areas of grey in the alpha channel will give shiny areas, but in most cases you only need a dark grey for enough shine unless you're modelling chrome or similar. Textures may need darkening a bit to compensate for the reflection from the sky but to my mind the ability to keep gloss and matt finishes within one texture makes tbumpenv the material of choice for most items of rolling stock.

To create m.tbumpenv simply follow the procedure to create a standard normal-mapped material (Paul Hobbs' tutorial is very good for this), but instead of naming it yourmaterial.m.tbumptex, name it yourmaterial.m.tbumpenv (I'm not sure about this but I believe the Blender exporter will automatically detect and name bump-mapped materials with the m.tbumptex suffix so I think you need to override this by correctly naming the material in Blender). You will then need to add an alpha channel to the diffuse texture map. This is not used for transparency, but instead to control the degree of reflection. Black areas in the alpha-channel give a matt finish, whereas shades of grey will give varying amounts of shine. You'll also need to add an Alpha=your.tga line into the diffuse texture.txt file.


From Paul Hobbs The problem is that Trainz lighting is too strong and at midday the effect goes haywire. At 6am the effect is great and just what I was looking for, especially for metallic surfaces such as brass safety valves. Unfortunately although tbumpenv materials simulate metal well, most bits of a loco are painted and have a quite different 'shine'.

Update: I've now managed to achieve specular mapping of a model using Blender. The trick is to use an alpha channel in the normal map of a m.tbumptex material which controls the strength of the specular. What the Dev Wiki doesn't tell you is that the specular of the material itself needs to be set to maximum (2.0) in Blender because this sets the specular strength of white areas in the alpha of the normal map. If the specular is set to 0 in Blender you don't get any variation which is why I thought it wasn't working... I don't like using m.tbumpenv materials because they reflect the sky colour and change the apparent colour of the model. Additionally they give the impression that the surface is completely smooth which in real life it never is. I suggest therefore simulating polished metal by using a m.tbumptex material with high value specular controlled by the alpha channel in the normal map.

From Torsten. I've looked into the material settings of your GMax Romulus(I couldn't take a look at it as I have unsolved missing dependencies) and tried to adapt the Blender settings to what I've found in your *.im file. The only thing not working is to export the reflection texture also as specular texture. I was unable to import it because CMP complain about a missing texture. I guess the message should be "Sorry, but specular textures are only supported as alpha channel of normal textures.". So I've dropped the specular texture and set the Blender material settings as following:

Material panel: Col: white Spe: white

Shaders panel: Spec: 2.0 Hard: 2

Texture diffuse MapTo panel: button Col pressed, all other released slider Col 1.0

Texture diffuse MapTo panel: button Ref pressed, all other released slider Var 0.5

An example of this technique is now on the DLS kuid 86627:1710

There is currently some discussion on the Trainz forum as to the precise methodology and this page will be updated when this has been determined.