1. A computer program product embodied on a non-transitory computer readable medium, comprising: computer code for: (a) generating photons and query locations; (b) determining a bounding volume of the query locations; (c) determining a set of the photons inside of the bounding volume; (d) determining whether the set of photons and the query locations meet a threshold including a number of query locations; (e) in response to a determination that the set of photons and the query locations meet the threshold including the number of query locations, computing a contribution of the set of photons to the query locations; and (f) in response to a determination that the set of photons or the query locations do not meet the threshold including the number of query locations: partitioning the query locations; and for each set of query locations resulting from the partitioning, repeating (b)-(f); wherein the computer program product is operable such that the query locations are partitioned according to a predetermined algorithm; wherein the computer program product is operable such that the predetermined algorithm includes sorting the query locations by x-axis, y-axis, and z-axis and partitioning the query locations according to a median of the sorted query locations.