Texels-to-meters ratio

From TrainzOnline
Jump to: navigation, search

The texels-to-meters ratio is a scalar which defines the size of a single texel. Trainz approximates a value per render chunk and uses this for texture streaming and other similar purposes. This is only an approximation, as a texel need not be square. Since the size of each texel depends on the geometry on which it is used (which may be different across the model, and may vary at runtime due to animation, procedural deformation, etc.) any such ratio calculated offline is inevitably only approximate.

It is the content creator's responsibility to ensure that the texels-to-meters ratio stays reasonably consistent across each render chunk. Minor variations are perfectly normal, but going outside the 50%-200% range is strongly discouraged and may result in the engine making poor LOD choices.

When performing parallax mapping, the texels-to-meters ratio is even more important, because surface displacement is derived from this. In this scenario, the offline-computed approximation is not used, but a value is calculated for each fragment. This is still a scalar approximation of a potentially-distorted mapping, however- the more distorted the mapping, the less accurate the scalar will be at representing it, and the more visible artifacts will result. It is the content creator's responsibility to ensure that no user-visible artifacts result from the use of overly-stretched textures.

Personal tools