1. A computer-implemented method, comprising: initializing a data structure that is configured to provide an importance value for each incident sample in a three-dimensional (3D) scene; tracing, in a direction from an origin, a first ray of a plurality of rays through the 3D scene to intersect an object at a hitpoint; selecting a next direction of the first ray according to a distribution of the importance values at the hitpoint; tracing the first ray in the next direction from the hitpoint to find a next hitpoint; updating, in the data structure, a first importance value corresponding to the hitpoint of the first ray using a second importance value in the data structure corresponding to the next hitpoint; setting the hitpoint of the first ray to the next hitpoint; repeating selecting the next direction, tracing the first ray in the next direction from the hitpoint, updating the data structure, and setting the hitpoint until the next hitpoint is an endpoint; and recording a contribution to a first pixel that is intersected by the first ray based on each hitpoint and the endpoint.