Advanced Light Path Ray Length

I am not sure this is the correct place for this question, please let me know if I should ask elsewhere.

I am trying to do a simulation of light transport throughout a scene. More specifically I want to render all of the photons (rays) that have traveled a specified amount of time (or equivalently distance). So basically I only want to render all of the rays that have traveled between a distance of x and y. The distance would be defined as the distance: light -> object -> camera; or, if there are multiple bounces: light -> object -> … -> object -> camera. I have been playing with the “Light Path” node’s “Ray Length” property but have been unsuccessful. It seems that the “ray length” only corresponds to a single ray, not the series of bounces the light takes from the lamp to camera.

Please let me know if you have any ideas about how to achieve the effect I desire, any help would be appreciated.

Thanks!

This is a little late, but… is the Z pass what you’re looking for? It gives you the distance (in Blender units) of the rendered objects. However, it counts all objects as solid / opaque, so it won’t go through transparent / refractive materials.