Stylized rendering - Painting highlights

Hello all,

I’m currently working on some stylized rendering. I would like to “paint” light (and highlight) based on my own computations. Currently I just have 1 light (directional) and I would like to use shadowmaps for shadows as well. For this, I have two questions:

  1. Is there a way in the material editor to get the direction vector of the primary light source? (or do I have to make this is a material parameter)

  2. Is there a way in the material editor to get information about whether the point is “in the shadows” or not? (that is, whether some other object casts a shadow here)

Thanks a lot in advance for all help.

Kind regards,
Uffe Flarup