Help:VE186

From TrainzOnline
Revision as of 08:29, 23 May 2017 by Pcas1986 (Talk | contribs)

Jump to: navigation, search

Category code 'ZX - Material 'arc:fld:$(local)/hash-nn||kuid nnnnn nnnnn.tzarc|**material name is shared between multiple meshes in this asset but the material parameters conflict.


Meshes that can share materials improve game performance, but when meshes within the same asset use the same material name, and the material differs, then that may result in unexpected behaviour.

The first time the game encounters a material name, that material is loaded with the material parameters that are defined for it. If the same material name is subsequently encountered in a mesh, then a new material is not loaded - the parameters already loaded are used. Those parameters might not be what was intended for that second material, and the rendering of the asset might therefore be incorrect. Also, as the sequence of loading meshes is not predictable, the resultant rendering will vary in different circumstances. To obtain correct, consistent rendering of the asset it is important to ensure that each material is loaded with the correct parameters for that material.


VE186 is a warning for assets with a Trainz Build less than 4.5, and an error for assets with a Trainz Build 4.5 and later.


A Trainz material, intended for use for two or more meshes within the same asset, must be identical for each mesh that uses the material. This includes material characteristics such as: opacity, ambient, diffuse, specular, emissive and shininess. Textures, where used in the material, must be the same number of textures, the same image, size, and texture type (TEX_DIFFUSE, TEX_BUMP, etc).

The following examples will result in a warning/error.

  • An asset uses the same material name for three different LOD meshes. Two meshes are exported with one version of the material but the last is exported with a variation, such as the material specular value.
  • As for the first example, but a texture is substituted, added or removed, for one of the meshes.
  • An asset is created with a two meshes both within their own source file. The same notex material name is used for both meshes but there is a variation in the diffuse colour.


Therefore:

  • Do not use the same material name if the materials should have different parameters
  • If you use the same material name in different meshes then ensure that the material parameters are the same.
Personal tools