So I understand how ray tracing works. And in shader nodes in Cycles you can use LightPath node to tell the renderer how certain material affects the rays that come from other object. For example if some other fragment (pixel) casts a shadow ray that intersects your material, you can use the isShadowRay to affect the value returned by that ray, up to making the material completely transparent for the shadow ray, i.e. not cast shadows on anything.
That's a very useful node, but is there a way to do the reverse? For example if my material casts a shadow ray, and it intersects some object, meaning that the shadow is cast on my material from light source. But can I take that returned value and affect it in any way? For example, it could be useful to make the shadow ray always return 0, i.e. no shadows are cast ON my material. I understand that you can achieve that particular effect through, for example, rendering layers, but I'd love to have that input available for me to do mode complex stuff.
Since someone misunderstood the question, I will ask again differently. Ray tracing works as such:
- Cast a ray from the camera
- It hits some pixel on our Material
- Then many other rays are cast in different directions to test which other objects/materials are around that pixel. Those are shadow rays, transparent rays, diffuse rays, etc.
- Each of those rays returns a value. The mathematical formulas are then used to determine the final color of the initial pixel that we have hit.
- I want to take those values in the shader and affect them.
What LightPath node does is the reverse of what I want. It affects the result that THIS MATERIAL returns to OTHER MATERIALS that have cast certain rays.