Summary
In this chapter, we have learnt how to use the GPU to offload the CPU in some rendering tasks. The butterflies example taught us how, parting from a plain array of 3D points, we can create on the fly more elaborated (in terms of mesh complexity) structures using only the GPU. A good exercise for you would be to give life to the butterflies by animating their wings (easy to achieve, changing the wings' aperture angle according to the time), coloring each butterfly instance differently based on gl_PrimitiveID, or calculating the strips' normal vectors to include lighting calculations.
In the next chapter, we will increase the flexibility of our renders with the usage of the compute shaders, which will allow us to perform other GPU calculations ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access