1. A computer-implemented method comprising: binning samples based on occlusion and based on distance from the user; defining a two-dimensional bounding box in light space where there is a shadow; summing the values of depth samples in each of a plurality of bins; calculating an integral of values in each bin with respect to depth to determine a possibility that a given sample falls in a given bin; positioning shadow map partitions to center each partition at a depth bin containing an average value within the partition; and using a user specified budget for memory utilization or computation time to determine the location of shadow map partitions.