Summary
In this chapter, we upgraded our renderer from showing only a single model to rendering a larger crowd of models.
First, we split the GltfModel
class into two parts, adding a new GltfInstance
class for the instance-specific variables and methods. This split enabled us to enhance the renderer to draw many instances of the same model. Next, we upgraded the renderer to draw instances of different models on the screen.
Then, we used the code of the first example with the split of the model and the instance class as the basis and added GPU-side instancing to the code to offload the drawing of the instances to the graphics card. Lastly, we explored TBO as an alternative way to transfer data to the GPU.
In the next chapter, we look deeper under the hood of the created application. We had to add an optimization in this chapter, but there is much more to explore and check on the CPU and GPU sides to make the application even faster.