CNA Samples

Instanced Model

Ported from Microsoft's XNA 4.0 Instanced Model sample.

Source for this sample on GitHub ↗

A thousand textured models spinning through nested spirals against a blue background. Play ▸

Opens in a new tab. Change rendering techniques and instance count to compare them.

About this sample

Drawing many copies of a model can spend more CPU time on repeated draw calls than on the geometry itself. This sample compares a straightforward loop, a loop that avoids repeated state changes, and hardware instancing that submits the copies in one draw. Each model follows its own animated spiral while the overlay reports the current technique, instance count and frame rate.

Controls

ActionKeyboardGamepad
Change techniqueAA
Add instancesXX
Remove instancesYY
ExitEscapeBack