1

Vector to orient normal node

Hi, I´ve followed this: How to correctly drive a normal node with lamp rotation?

I´ve tried the same setup but I need an empty to drive the direction of the mapping node onto the normal shading. I think the problem is on the curve drive. What I need is to translate the empty on world space and the mapping node will update the normal node as if it was the "light" direction. Please help.

Pierre Schiller
  • 2,954
  • 1
  • 11
  • 34
  • Also is this question related to https://blender.stackexchange.com/questions/47175/i-want-to-mix-cycles-shaders-based-on-self-shadow – 3pointedit Apr 02 '18 at 08:15

1 Answers1

1

I propose a similar setting, but where the normal is driven by a vector defined by the difference between the empty location and the rendered point location (that could be whole sphere location instead).

Here is opposite views when the empty is moving:

enter image description here

Here is the material setup:

enter image description here

  • The driver is set on the location vector of a mapping (with no input)
  • From that there is the calculation of the difference between the driven values and the rendered location
  • The output is normalized and plugged as normal vector

Each driven axis is defined this way, respectively for X, Y and Z:

enter image description here

lemon
  • 60,295
  • 3
  • 66
  • 136