Cycles Shader to assigns a color based on how many light sources hit the surface I would like to create a Cycles Material that assigns a color to the points of an object's surface based on how many light sources hit that point.

If, for example, there are 10 light lamps into the scene (and no ambient occlusion nor emissions from anywhere), each will contribute with a (0.1, 0.1, 0.1)RGB to the final color of the object surface if any of its rays hit it.

Do you think it is possible? Any suggestions about how to achieve this?

Thanks!

EDIT: (To be a little more specific). For an academic paper I'm writing, which will be a bit long to describe, I need to know how many lights are contributing to the color of a specific point of a surface. My idea was to paint this point with a tint obtained by adding the colors of those lights that hit it. In this way I don't know which lights are hitting a surface point (which could have been even better) but at least I know how many of them contribute to its final color.
This is possible using the Toon shader which can be set to produce completely 'flat' shading that is only dependent on the incident lamps. By also setting the lamps to 'Constant' shading the effect of each lamp can effectively be clamped to a constant contribution for each visible lamp.

Start by setting your lamps to 'Constant' illumination :



Adjust the Light Falloff node to adjust the Strength of the lamp. This will result in each lamp contributing the same illumination to a surface regardless of distance.

For the mesh material, use the Toon shader with the Size and Smooth values set to 1.0 to give completely 'flat' shading. Also, set the Render properties Light Paths for 'Bounces' to zero as we don't want to take account of any bounced rays :



This can produce the following result :



Blend file included 

Note that you may also want to reduce the lamp size from the default size so as to ensure sharp shadow edges.