Texels-to-meters ratio

From TrainzOnline
(Difference between revisions)
Jump to: navigation, search
(Created page with "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 a...")
 

Latest revision as of 10:33, 19 October 2017

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