1. A method comprising: receiving a combined pixel shader program having a first set of instructions; automatically deriving, by a processor, a culling program having a second set of instructions, and a pixel shader program having the first set of instructions, said second set of instructions being derived from said combined pixel shader program, wherein deriving includes selecting a subset of the first set of instructions in the combined pixel shader program so that the culling program includes less than all of the first set of instructions from the combined pixel shader program and modifying said subset of instructions to use interval arithmetic such that the culling program's second set of instructions consist of the modified instructions; while rasterizing a primitive, selecting a first plurality of fragments to process; wherein the processor executes the culling program for the first plurality of fragments; and based on the output of the culling program, selects a first shader program to execute on the first plurality of fragments from a set of shader programs including said pixel shader program; and while rasterizing the primitive, selecting a second plurality of fragments to process and repeating the preceding steps for the second plurality of rasterized fragments, including executing the culling program on the second plurality of rasterized fragments, based on the output of the culling program, selecting a second shader program to execute on the second plurality of fragments from a set of shader programs including said pixel shader program.