I am writing postprocessing script to the cycles rendering.
Can I somehow track the whole lightpath of a single pixel from the camera to the origin of the light? For example the I have 3 lamps(A, B, C) and an environment map in my scene. I want to know that pixel (200,100) is in 30% made from light of lamp A and in 70% from lamp B.(some of render samples came across one, some across another) And pixel (300, 200) reflects the environment map’s coordinate (2000,1000). Is there any way to extract the information about from where the light comes, maybe at least from single render sample?(since in one sample each pixel should reflect/refract only one light source) If so, at which level I should integrate with blender? Python scripting is ok or do I need to recompile some parts of cycles?
My final point is to find origin of each light path and track how the object interacts with environment.