next up previous contents
Next: 18.4.2.2 Use Simple Fill Up: 18.4.2 Minimizing Per-Pixel Calculations Previous: 18.4.2 Minimizing Per-Pixel Calculations   Contents

18.4.2.1 Avoid Unnecessary Per-Fragment Operations

Turn off per-fragment operations for objects that do not require them, and structure the drawing process to minimize their use without causing excessive toggling of modes. For example, if you are using alpha blending to draw some partially transparent objects, make sure that you disable blending when drawing the opaque objects. Also, if you enable alpha test to render textures with holes through which the background can be seen, be sure to disable alpha testing when rendering textures or objects with no holes. It also helps to sort primitives so that primitives that require alpha blending or alpha test to be enabled, are drawn at the same time (and hopefully after all non-transparent primitives).



2001-01-10