1 / 12

4 . 7 . Instancing

4 . 7 . Instancing. Introduction to geometry instancing. Instancing. Introduction to geometry instancing. Explore the DirectX SDK Instancing sample. Instancing. Geometry Instancing.

chava
Télécharger la présentation

4 . 7 . Instancing

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 4.7.Instancing Introduction to geometry instancing

  2. Instancing Introduction to geometry instancing

  3. Explore the DirectX SDK Instancing sample • Instancing

  4. Geometry Instancing 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. Geometry Instancing 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 to1k-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. Geometry Instancing 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. Geometry Instancing (Hardware instancing) 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. Geometry Instancing (Shader instancing) 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 • Instancing

  10. Directed reading Directed Reading Directed reading concerning geometry instancing

  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 Directed reading

  12. Summary Today we explored: • Different geometry instancing techniques To do: • Read the directed reading • Think if you would like to consider instancing within your project

More Related