1. A computer-implemented method for rendering images of objects in computer-generated scenes, the method comprising: receiving, at one or more computer systems, information identifying a location for each ray in a first plurality of rays at which the ray intersects with an object of a computer-generated scene; sorting, with one or more processors associated with the one or more computer systems, the location for each ray in the first plurality of rays into at least one group in a set of one or more groups before pursuing deeper in the computer-generated scene from the location of at least one ray in the first plurality of rays based on whether the location for the ray can be shaded together with another location for another ray at which the another ray intersects an object of the computer-generated scene; generating, with the one or more processors associated with the one or more computer systems, information configured for rendering an image of the computer-generated scene for a shader program associated with a first group in the one or more groups; and storing the information for the shader program associated with the first group in the one or more groups in a storage device associated with the one or more computer systems.