Download presentation
Presentation is loading. Please wait.
Published byHomer Norman Modified over 9 years ago
1
4.7. I NSTANCING Introduction to geometry instancing
3
Explore the DirectX SDK Instancing sample
4
Games often have to render many objects of a similar type (perhaps differing only in terms of colour, position, orientation, etc.). Rendering a large number of objects (each with a limited number of polygons) can stretch modern GPUs, which are not designed to render a small number of polygons thousands of times per frame (the pre-call setups costs very quickly accumulate).
5
Submitting triangles to the GPU for rendering is a relatively slow operation. On modern hardware about 30k-120k batches per second is readily attainable. This amounts to 1k-4k batches per frame at 30fps. Instancing attempts to minimize the number of draw calls, alongside state changes, and render the same triangles multiple times within the same batch in a single call.
6
Instancing requires the vertex and index data to be organised in a particular way so that multiple copies of the mesh can be drawn per batch. Instancing is best suited to tasks where the model to be instanced is relatively simple (<1000 triangles). For a complex model, instancing will return little, if any, benefit, as the performance bottleneck will become GPU bound.
7
Hardware instancing sends two vertex streams to the GPU. One stream contains the normal vertex data and a second stream holds instance data (position, colour, etc.). The advantage of hardware instancing is that the original mesh need only be sent once to the GPU (saving memory).
8
Shader instancing builds a vertex buffer which holds a number of copies of the original mesh. The buffer is then used to draw batches of the original object. Instance data is set within the shader using constants. The number of objects drawn per batch is constrained by the maximum number that can be stored within the vertex buffer and the number of available shader constants (e.g. 256 for SM2.0)
9
Explore the DirectX SDK DX10 Instancing sample
10
Directed reading concerning geometry instancing Directed reading
11
Directed reading Read Batch, Batch, Batch: What Does it Really Mean – for information on the importance of batching within games Read GPU Gems 2 – Inside Geometry Instancing for more information on instancing Read GPU Gems 3 - Animated Crowd Rendering for more information on advanced instancing
12
To do: Read the directed reading Think if you would like to consider instancing within your project Today we explored: Different geometry instancing techniques
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.