Modeling Scenery

From TrainzOnline
Jump to: navigation, search

"Scenery" is the Trainz term for hand-placed modelled objects. Scenery types are used for modelling discreet objects such as buildings, stations, foliage and custom rock-faces. The route creator positions each scenery object individually in the route. By default, Trainz will place the scenery origin at ground height, but the creator may choose to embed the object into the ground or suspend it in the air.

Contents

Orientation

Models built for scenery objects are positioned with the origin at ground level and centred in the model. If the model has a distinct "front", it should face toward the negative Y axis.

TBD: Image of single scenery mesh against axis lines.


Animation

While any scenery model may be animated, creators should keep in mind that animation is exceedingly expensive in terms of performance. Route creators should provide a discreet number of animated objects per scene, rather than attempting to animate every object in the scene. Animating wind in foliage is an example of poor design. Since the animation cost tends to be per-object rather than per-polygon, it's best to animate a larger, more complex, more visible object in the scene rather than focusing on small details.

Animated objects are not subject to mesh stitching. Placing ten identical animated objects in near proximity is roughly ten times as expensive as placing just the one.


Level Of Detail

Two LOD techniques are available to scenery objects. The first, 'LM.txt', is available to non-stitched meshes, including animated meshes. The second technique, 'lod-mesh', is available to non-animated meshes and is compatible with mesh stitching.

LM.txt

The LM.txt file format allows specification of a model which switches geometry as it moves away from the observer. It supports animation seamlessly through the LOD process, and allows hiding child attachment points at lower levels of detail. It acts as a substitute for a normal "*.im" mesh file. This format is suitable for complex, animated objects and is incompatible with mesh stitching.

TBD: provide usage example here.

lod-mesh

Each "mesh-table" Container entry supports a 'lod-mesh' tag which specifies at which detail level the mesh should be visible. The mesh is only rendered when the object is at the specified detail level. This system works independently from and in addition to any other mesh visibility constraints - it will not make an invisible mesh visible regardless of the detail level, and setting a mesh visible from script while at an inappropriate detail level will not cause it to render. If no 'lod-mesh' tag is specified, the element will be visible at all detail levels.

TBD: provide lod-mesh usage example here.


Materials

An efficient scenery object must share a single material between all meshes. This means that your asset will contain multiple LOD meshes, but only one diffuse texture and one normal texture. Some meshes may reuse the same area on the texture, while other meshes may need a distinct area due to differences in the geometry. Typically the texture will not be set as tiling, and any tiling will be performed using the geometry - attempting to tile the texture will usually result in difficulties with fitting the multiple meshes onto the single texture page. In order to enable material sharing, all meshes should use the same named material with the exact same material parameters. The easiest way to achieve this is to source all of the meshes from a single MAX file, where they use the same material. TBD: Link to page explaining how to do this.


Night Mesh

TBD.


Effects

Most "effects" Container entries in the "mesh-table" Container are expensive, and they should be used sparingly.

Typical Polygon Counts

TBD.


References

Personal tools