21. A method for servicing photon map queries, comprising: accepting photon queries from one or more code modules or shaders, each of the photon queries defining a spatially located volume and criteria for photons that are responsive to that photon query, at least some of the photon queries defining a locus and a number of photons (k) closest to the locus as the criteria, wherein k>=1; associating each of the accepted queries with a collection of photon queries that is associated with a node of an acceleration structure, the acceleration structure including nodes that respectively define surfaces that each spatially bound a respective selection of photons located in a 3-D scene, the selections of varying relative granularity, and the nodes arranged in a graph with edges connecting pairs of nodes; traversing the acceleration structure with collections of photon queries from the accepted photon queries, wherein the traversal is performed, collection-by-collection, by testing, in an acceleration structure resource comprising one or more processors, each of a plurality of child nodes of the node associated with a selected collection of photon queries for overlap with each of the spatially located volumes of the photon queries of that collection, and updating a status of collections maintained in a memory by referencing each photon query in a respective collection associated with each child node found to overlap with the spatially located volume of that photon query; and returning, for each of the photon queries, identifiers for photons satisfying the criteria specified for that photon query.
26. The method of claim 21 , further comprising producing a data structure for each photon query that includes definition data for that photon query and one or more of data to be passed to a shader and a pointer to code to be executed in response to resolving the query.