Hardware instancing
From TrainzOnline
Revision as of 13:38, 17 January 2018 by Tonyhilliam (Talk | contribs)
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.