Hardware instancing

From TrainzOnline
Revision as of 19:25, 11 October 2017 by Windwalkr (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Hardware instancing is a technique which allows the GPU to render multiple identical meshes in a single draw call, varying a limited amount of state (such as position and orientation) for each mesh. This is used to reduce the cost of drawing a moderate number of identical low-to-mid-detail meshes. Where mesh stitching is possible, it is currently used in preference to hardware instancing. Strictly speaking, instancing is performed per render chunk rather than per mesh.

Cases where hardware instancing is possible and mesh stitching is not possible include:

  • Meshes attached to moving or animated parents, such as sub-meshes attached to a Train Vehicle.
  • Render chunks which exceed the maximum vertex or index counts (currently 3000 of either).

Cases where hardware instancing is not supported include:

  • Meshes which are subject to software-controlled manipulation (such as track splines).
  • Meshes with skeletons.
Personal tools