Making a light source invisible to everything except shadow rays I saw this in another answer and I would like to know how to do it:

"Making a light source invisible to everything except shadow rays will cause it to only block light from other light sources and not influence anything else."

Thank you!
There are two ways to do this.

Materials nodes:



Ray visibility:



Using these ray visibility checkboxes instead of nodes will speed up render times a little, however you lose the flexibility of nodes.