Build your own

Variations

Every 3D model consists of at least one variation file in .glTF or .X format. If a 3D model also has other characteristics, such as a different colour, then these characteristics can be added as additional variations in the form of extra model files. Users of 3D Train Studio have the option of choosing a variation on the layout without having to drag another 3D model from the catalog onto the layout.

When are variations available?

Several model files should always be combined to form a 3D model with variations if the models do not differ in their function and have a strong visual similarity.

Examples:

  • A coach has variations for 1st and 2nd class.
  • A vehicle is painted blue, red, and yellow.
  • A track has a variation with bedding and one without.

In case of doubt, the forum helps to make a decision as to whether certain models should be grouped into variations.

Notes

  • The name of the variation is derived from the file name. Since the name also appears in the selection list for the user, it makes sense to use meaningful file names.
  • Animated models must use the same animations, or if there are several variations, only the animations of the standard variation are taken into account.
  • A maximum of 50 variations per model is supported.

Variation lists

If a 3D model consists of several variations, it would be tedious to load each variation individually into the Studio or to update them if the variation models have changed. Variation lists make this task easier. A variation list is a plain text file with the file extension .varlist.

A line in the variations list consists of three semi-colon separated fields::

Name of the variation; file name of the model; texture file substitutions, if any.

  • One line corresponds to one variation.
  • The first variation is set as the default variation.
  • Texture file substitutions are optional. If there is more than one, the list is comma separated.
  • File names must be specified relative to the path of the variation list file.
  • Be careful to use the correct field separators. A semi-colon must be used between the three main fields and a comma between any texture file substitutions in the third field.

By specifying the model and texture files separately, it is possible to create different variations from just one basic model when importing into the Studio.

Variation list example

This example is for a 3D model wagon with black wheels, footplate and running gear. The superstructure is available in two variations, red and green.

Only one model is made, the red one. The substructure is coloured using a black texture file called black.png. The superstructure is coloured using a red texture file called red.png. Another texture file contains the green texture, green.png, but this file is not referenced in the model.

The wagon.varlist file will look like this:

Wagon in red;wagon.gltf
Wagon in green;wagon.gltf;red.png=green.png

The human readable variation name comes first. Next is the name of the .gltf file for the wagon. This is the same for both variations. There follows a list of texture file substitutions, if any. In the case of the red wagon, there are no substitutions because the design has been created for the red wagon. In the case of the green wagon, red.png is substituted with green.png.

Other texture file substitutions, if any, may follow on the same line as a comma separated list.

Wagon in green;wagon.gltf;red.png=green.png,grey.png=pink.png

Note that black.png is not referenced in wagon.varlist, since it is the same for both variations. However, the file black.png must be present as it is referenced by wagon.gltf.

Sources of Textures

Exchange textures

Exchange textures expand variations by the possibility of exchanging a texture of the 3D model with a texture created by the user, and thus to individualise the model to a certain extent according to one’s own ideas. Every texture that bears the name _Custom (the file extension does not matter) is recognised as an exchange texture and can be exchanged by the user.

When are exchange textures suitable?

While variations are defined by the model maker alone, swap textures offer the possibility of giving the user their own design tools. Exchange textures are not uploaded to the online catalog when a system is shared. Exchange textures are therefore suitable for individual adjustments that are not intended for the general public:

  • Individual names on station or town signs.
  • Personal names on license plates.

Here, too, the forum is suitable to help you decide on variation vs. exchange textures in case of doubt.

Materials and textures

The Studio uses Physically Based Rendering (PBR) materials in the standardised metallic roughness workflow, whereby a material consists of different parameters / textures. “BaseColor”, “Metallic”, “Roughness” and “Emissive” are supported in the Studio.

While metallic tends to be binary in practice (0 or 1), roughness controls the reflection of a material. The emissive property controls how much light an object emits on its own. The higher the value, the more the material is interpreted as a light source. This also has an influence on overexposure (blooming), for example.

By using textures for the individual parameters, different properties within a material can be assigned to an object. Different areas of a locomotive can be shiny, other areas worn and dull, with just one material.

Since not every file format supports PBR materials (e.g. the older X format), there is a special solution in the Studio. If there is another texture in addition to the normal texture that contains the extension _Metallic, _Roughness and / or _Emissive , these textures are used accordingly when importing into the Studio, regardless of the material setting in the file format.

Further remarks

  • Each material is processed separately by the 3D engine, so it is advisable to reduce the number of materials used to a minimum (ideally to one non-transparent and one transparent material).
  • The Studio supports different file formats for textures. The PNG format is recommended as it is lossless and allows post-processing. JPEG should be avoided as compression artefacts can easily become visible.
  • The width and height of all textures must be a power of two, e.g. 64, 128, 256 etc.
  • Textures with semi-transparencies (alpha values) should not be mixed with textures without transparencies. More precisely, the Studio ignores all transparencies of textures if they do not consist of at least 75% transparent pixels.
  • Regardless of the file format, the Studio automatically converts all textures into a file format (DXT) optimised for the graphics card and selects the optimal settings.

Community member maxwei has provided further information on the configuration of PBR materials (especially for Blender):

Quick Guide to MBS Materials PDF, 555Kb, 6 pages, English. Translation by 3D Studio UK.

Instructions for using MBS materials (Emissive) PDF. 414 Kb. Computer translation of German language original.

Labels

Starting with 3D Model Railway Studio v8, 3D models support text and labels that can be customised by the user (for example, train destination displays or signs). The labels are part of the model textures and are updated by the Studio when they are changed. Every base and emissive texture supports labels. The information is read from a TXT file (UTF-8 encoded) that has the same name as the texture.

Example of a label file:

[0]
Name = label
Text = Plymouth 5 miles
FontName = railway font
FontSize = 36
FontStyle = Bold, Italic
FontColor = FFFF8000
Animated = False
Align = Center, Top
Area = 90,438,493,510

Each texture supports up to 20 labels. The following properties exist for each label:

  • [0] – Consecutive label number within the label file. The number itself has no meaning, but it must be unique within the file.
  • Name – Description of the label as presented to the user. The label is also addressed using this name via event management. Note : Different labels of a 3D model can use the same name. In this case, all labels use the same text, which is useful, for example, for train numbers that are positioned at different points in a 3D model (in different versions).
  • Text – content of the label for new 3D models, can be customized by the user as desired. A line break is inserted above the character string \n.
  • FontName – Font of the label. The following fonts are included in the Studio and are supported:
    • Auto Digital
    • Arial
    • Railway writing (standard)
    • Bahnschrift Condensed
    • Consoles
    • DIN 1451 medium font DB
    • Dot Matrix
    • Futura Book
    • Old Town
    • Times New Roman
  • FontSize – text size in pixels
  • FontStyle – Text style, supported combinations of Bold , Italic and Underline , or blank for the default style.
  • FontColor – text color as a hex value in the format AARRGGBB (alpha, red, green, blue)
  • Animated – Indicates whether the text is scrolling text (True/False). Note: A caption will only be animated as scrolling text if the text content is larger than the caption area.
  • Align – Align the text within the caption box. Left , Right and Center (horizontal) and Top, Bottom, VCenter (vertical) are supported .
  • Area – coordinates of the label field within the texture in pixels (left, top, right, bottom)

Performance: Static labels that are adjusted irregularly by the user do not incur a performance demand, as such labels are updated in the background. Textures with scrolling text, on the other hand, must be continuously updated by the program, which is why such textures must have a maximum size of 0.25 MPixel (e.g. 512 x 512 or 1024 x 256). For scrolling texts, it is often a good idea to use your own material. You should also avoid combining static texts with running texts on a texture, at least as long as there are significantly more static texts than running texts.

Details (LOD)

Graphics cards can process only a limited number of polygons per second, depending on the card’s performance level, which is why it makes sense to create 3D models using as few polygons as possible. If optimisation is no longer possible, an additional level of detail should be built and added to the model. Levels of detail allow the Studio to display a less complex model if it is so far away from the camera that details are no longer visible.

  • Levels of detail are loaded automatically when the model files end with the name _LOD1 or _LOD2
  • The switching of the levels of detail is done automatically by the Studio and depends on the model size (large models are switched later than small ones)
    • LOD1 is used for medium distances at which objects can still be seen well but are no longer in the focus of the observer
    • LOD2 is used for long distances where only the outlines of the object are visible
    • LOD1 is optional if there are too few differences between the main model and LOD1
  • Each level of detail should reduce the requirements (polygons or materials) by at least 30%.
  • LODs can be made by deleting objects from the base model, but not by adding new objects. For example, replacing a cylinder with a cube to reduce the number of faces won’t work.

Tips for creating levels of detail

  • At low levels of detail, small details should first be removed that are hardly noticeable at a certain distance anyway (e.g. wiry pantograph, small objects, curves). As long as the contour of the model is roughly retained, small changes in details are hardly noticeable.
  • Levels of detail that are only displayed at a great distance can do without special objects such as wheel animations or moving bogies, since an animation or a rotation is barely perceptible at a great distance.
  • Avoidance of transparent objects and thus the inner workings with low levels of detail

Animations

The Studio supports any number of predefined keyframe animations for each 3D model. Multiple animations can be defined in Blender, in Autodesk 3ds Max, or in any other program that can export timeline-based keyframes. It should be noted that several animations that are to be addressed separately in the program must be created one after the other in the timeline. The reason is that most 3D programs do not have a clear definition of multi-animations and therefore only ever export the timeline as one overall animation, which the Studio then has to separate into individual animations.

The overall animation is separated into individual animations by means of an additional animation file that has the same name as the model, but uses the ending .anim and must be in the same directory as the model. The animation file is a simple text file and contains exactly one line for each animation. A line is structured as follows:

Animation name; Startframe; Endframe; AutoPlay; Loop
  • Animation name – The name of the animation as it will appear in the Studio. Meaningful identifiers should be used. The animation name should not be changed later, since actions in event management, for example, reference the animations by name.
  • Startframe – The key frame with which to start the animation.
  • Endframe – The key frame with which to end the animation.
  • AutoPlay / NoAutoPlay – “AutoPlay” specifies that the animation should start automatically when it is pasted onto the system. “NoAutoPlay” is used to pause the animation at the beginning.
  • Loop / NoLoop – “Loop” indicates that the animation starts in an infinite loop by default. “NoLoop” indicates the animation is only played once by default.

This is an example of a line of an animation file that defines the animation “Door”, which runs from keyframes 0 to 15 inclusive and starts automatically, but is only played once.

Door; 0; 15; AutoPlay; NoLoop

Sounds

Each 3D model can be linked to a sound from the catalog. Notes:

  • Not every 3D model needs a sound. In order not to annoy the user with loud sounds, only selected models such as vehicles, barriers or larger railway objects should be assigned predefined noises. At the end of the day, the user still has the option of adding a sound source to add their own sounds to the system.
  • When adding sounds to the catalogue, they should be in OGG format (compression level 6 is recommended) and normalised to the standard level (e.g. via the free Audacity, normalise to -1.0 dB). The sounds can also be saved in mono, as the Studio positions the sounds independently in 3D and plays them accordingly on different speakers.

Special objects

To recognise special functions, the Studio uses certain naming schemes from 3D models and noises. If a sub-object of a 3D model or an animation has the following name, additional functions are activated:
Special objects

  • _Scale_1_100_mm – Indicates the scale and the unit in which the model was constructed in the 3D program. Instead of 1_100, any other scale can be selected (the first number indicates the numerator, the second number the denominator). Instead of mm, it is also possible to specify cm or m. A _Scale object is not displayed, only the name counts. Without a _Scale object, a query dialog appears when importing the 3D model in order to specify the scale.
  • _CP – If an object begins with this name, it is interpreted as a contact point. Contact points automatically connect to other contact points. The orientation of the object determines the direction in which an object is rotated when it is connected. Contact points are not drawn, so their geometry is irrelevant for the Studio.
    • _CP_Source – From v6. The contact point is automatically linked to other contact points that are marked as target ( _Target ). Example: A contact point of a load. If the load is placed on a wagon, it is linked to the wagon and automatically moves with it.
    • _CP_Target – As of V6. The contact point is automatically linked to other contact points that are marked as a source ( _Source ). Example: A contact point on a wagon. If a load is placed on the wagon, it is linked to the wagon and automatically moves with it.
    • _CP_Spline – If the contact point contains the extension _Spline, then the point does not snap into place at other contact points, but on the tracks of tracks and roads.
    • _CP_Track – From V5. Same behaviour as _CP_Spline, but applies to track contact, ie the contact point triggers a “Track contact is triggered” event when a vehicle touches the contact point.
    • _CP_Track_Dynamic – From V7. Corresponds to a track contact that can be moved dynamically by the user (e.g. to change the distance to the signal and / or to configure the parallel distance).
    • _Top – from V5. If a spline or track CP contains this extension, the point will snap into place on the upper edge of the track, where the rolling stock touches down.
  • _LS (up to V5) – An LS object is interpreted as a light source. All objects with this name are assigned a material that always lights up, even at night. Is no longer supported from V6, as the emissive property of the PBR materials can be used for this.
  • _LC – An LC object is interpreted as a light cone (light cone). These objects also always shine, and have the additional properties that their texture is drawn using the additive method, which enables brightness gradients. If an LC object does not have a texture, it is given a standard texture that resembles a cone of light. Vehicles automatically show or hide LC objects depending on the simulation time.
  • _ENV_X (up to V5) – Objects that contain the character string “_ENV_X” in their name reflect the environment with a strength of X (between 1 and 100). Is no longer supported from V6, as the roughness property of the PBR materials can be used for this.

Special objects that should not be drawn by the Studio can be created in Blender, for example, by using null objects: “emptys”.

Special animations

  • _Time – The animation time is synchronized with the simulation time of the system. The beginning of the animation corresponds to midnight, the end of the animation to midnight.