8
$\begingroup$

I know how to make it simple with textures. I wonder how to implement blinking or eye movement. I've been looking for a YouTube course and there's a few textures that say eye rigging, but I'm not satisfied.

enter image description here It's made by someone on the Internet, so I need you to teach me how to do it like this.

enter image description here

enter image description here

I saw there was no mask on the shading node, how did you do it? enter image description here

$\endgroup$
7
$\begingroup$

From what I understand he uses drivers to control the Mapping X and Y location values with an empty. To do that you need to create your object, an empty (parent it to the object) and this kind of setup:

enter image description here

Then right click on the Mapping X location value of the eye texture and choose Add Driver, then in the driver's window you need the following settings: Object > Empty, Type > X Location, Space > Local Space, also find the good Expression variable which seems to be "*-0.2" for me (?):

enter image description here

Same thing to make the eyes move on the Z axis, right click on the Y location value, but this time you need to choose Type > Z Location.

You could also control the eyes with the Texture Coordinate's Object option and choose an empty as Object on the bottom.

For the eye blinking you could draw the eyelid on the same image as the pupil, you'll just need to move the empty until it's visible.

You can also use a bone instead of an empty.

$\endgroup$
0
6
$\begingroup$

Looking at the node setup it seems the idea is you have multiple textures:

  • body
  • eye white (sclera)
  • eye black (iris + pupil)
  • eye mask, using red channel as alpha channel.

And the idea is that you draw the body, then the eye white, masked by eye mask, then you move the eye black some distance away from center in the direction of an empty or a bone or anything else controlling the eye movement, also masked by the eye mask.

Now, actually in your setup the eye white and eye black are combined together. Makes sense especially if the eye white is not a solid color and you want it to move together with the eye black.

Of course in actual shading the idea is implemented slightly differently:

  • if you're outside of a mask, draw body texture
  • otherwise draw eye black+white, with the coordinates translated by an empty (or bone etc.)
  • you probably want to clamp the values to some maximum value, so the black doesn't go outside the mask (so it becomes invisible or travels into the other eye)

In the node setup below I'm using the vector difference (separate distances on axes) of the empty to the center of the cube, and vector-add that to the UV:

Unmuting the nodes will enable clamping:

It works only because I rotated the cube so it looks upwards and the X/Y axes of UV and object coordinates are aligned. You need to parent the empty to the cube in this configuration before rotating the cube, so that the setup works in any orientation of the cube.

$\endgroup$
2
  • $\begingroup$ Notice how squinting is impossible in this setup. You would need to detect left/right eye (probably just by separating XYZ, and checking if X < 50%), then apply a different offset based on that (the offset has to be arbitrary I think, because the UV mapping is arbitrary), and then preferably also multiply the vectors so that the scale of UV coordinate space matches the scale of the object coordinate space. $\endgroup$ Jun 19 at 11:24
  • $\begingroup$ thank you very much $\endgroup$ Jun 20 at 5:28

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.