No immediate drawing (performance hit) • Upload objects (vertices, textures) to the GPU memory and reuse • Programmable rasterization (With fragment shaders)
texture for more images • Packing • Use a simple algorithm – divide texture to equally sized regions • Highly dynamic but wastes space in texture • Useful for icons
so we must render text to texture and upload – slow • Instead render individual glyphs to texture atlas and reuse when drawing • Draw more glyphs of them with one draw call
if not necessary • Track state of GL_SCISSOR_TEST, GL_STENCIL_TEST, GL_BLEND_TEST and don’t enable/disable if already enabled/disabled • Don’t change glViewport and glScissor if it already is set correctly
Combine shaders into bigger shaders • Non-texture drawing • Texture drawing • Shaders for scaling, gradient drawing, etc. • Switch between modes with a shader parameter (and switch or if inside shader)
on the CPU is expensive – we can draw lines on GPU • Anti-aliasing using shaders • Also used for line drawing, polypolygon and polygon outline and anti-aliasing
calls • Batch drawing to be able to reorder and combine same draw actions • Current state: • (Poly)Polygon, Rectangle, (Poly)line and text rendering is batched. • Gradient, most texture rendering is not (yet).