Costly GPU operations
As it runs for each pixel fragment shader of the frame, it is the most performance-sensitive part of the pipeline. Thus, we should to use the simplest shader possible. One cool trick is to use textures to store lookup tables in order to replace complex functions!
Alpha blending is quite a costly operation, because it must read and write to the frame buffer, thus, potentially consuming twice as much memory bandwidth. So, we should be wary of blending if we are looking for optimal performance.
Also, the stencil and depth tests are big performance factors, and if we can avoid them, we will improve the performance. For example, sometimes we can live with a smaller 16-bit depth buffer or disable it entirely when rendering ...
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