Get light position in shader for 2D lightning I'm trying to replicate an effect/shader I've seen used in Ori and the Will of the Wisps, a videogame. Basically it's a 2D game with real-time lightning. The lightning in 2D is achieved by having various versions of the sprite with light drawn-in manually at various angles and then based on the position of the light source, two or more drawings are blended together to create the final lit sprite. This effect is not normal map based, so just dropping a light in the scene would just give flat lightning to everything. I wanted to replicate the effect in Blender because I think it would be interesting. I was thinking about trying this in both Cycles and Eevee.
From my googling and trying stuff in the shader editor though, I haven't found a way to feed the light position in the shader. I've seen the Light path node, but from my understanding it's just a boolean that says if a ray is of a certain type or not, without info on the location where it's coming from.
Is there any way to achieve this?
If you want the location of the light in World space, you can do it with drivers:

That's the disconnected Combine XYZ node labelled 'Light Location'  in the illustration. Pin the material's node editor open for convenience, right-click each of the X, Y and Z fields in the light's Transform &gt; Location panel, select Copy as New Driver, and right-click &gt; Paste Driver in the XYZ fields.
You can also do it without drivers, by adding/subtracting the coordinates of the shading-point in various texture-spaces. However, you probably don't want the light's location in rotated spaces.. the only way I can think of getting round that is to associate an un-rotated target Empty with the objects of interest. I've called them 'Locators'. They have Copy Location constraints on their objects, but don't rotate with them.

Then the Yellow Vector Math node in the illustration gives the Light's location with respect to the cube's location, and the Turquoise one gives the Light's location in World Space.
Drivers are probably the way to go, otherwise it's more fiddly to reproduce the material for different objects.