1
$\begingroup$

I'm making a setup that reduces the complexity of shading by replacing the Normals with coordinates from an object. If you take Object Coords of an empty and plug them into the normal socket of a shader, you end up with the object being shaded as if it were a sphere. If you make some edits to each axis, then you can change the shape more. In this setup, the sphere is distorted quite a bit to give the shading I want for the face: enter image description here

So this all works quite nicely. The problem is when the head moves: enter image description here

What we see here is that the altered normals are masked only to the face, with the real normals still in use further up the forehead. As the head rotates, you can see the shading desync. It rotates with the head, instead of the light moving over it. This is because the Empty is parented to the head bone. I'm not sure exactly what's going on, but its something to do with the coords of the object being in the wrong space (world or object). I've tried Vector Transform node, but it doesn't help.

If the Empty only copies the location of the head and not the rotation, then there's no problem. But that only works if the head only rotates on Z, and never tilts or rolls. So it's not a proper solution.

I'm looking to understand why the coords from the empty are behaving wrong in the first place, and what can be done to make things stay properly synced up as the head moves. Someone has suggested that they might need to be multiplied by the Matrix of the object. I could get the Matrix info via drivers, but I'm not sure what to do with it after that.

$\endgroup$
1
$\begingroup$

The solution was to multiply the Vector by the empty object's Matrix. I built this group with some help and a lot of trial and error. The values are driven by the Matrix World of the Empty from the Data API. I'm not sure I have the component nodes of the matrix laid out properly or not, but this is working. enter image description here

enter image description here

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.