"Helllooooo !!!!"
 
 

Creating eyeballs in Softimage XSI
Part 2

 

The Shader

The 'white_eye' shader, should as the name suggests, be white. It should have a fresnal reflection effect so that reflections are more visible at the side of the sphere, than face on. For this we can use an incidence shader plugged into the reflection component of the phong shader. It should also have a high specularity value so that we get nice specular highlights.

Click to enlarge
click imageto enlarge

Because I have gone for a cartoon style eye, I have plugged a gradient shader into the diffuse colour........you too should play around with these setting depending on your characters style.

The Pupil

The pupil shader is a constant black, so use a constant illumination model. There should be no specularity or shinness, this is part of the eye that sucks light in, a bit like a black hole.

The Iris

My iris shader uses a texture map for color, although to be fair it's not anything special. You could also use a specular map as well so that it lights in a realistic manner. The specular settings have been set so that you get a wide highlight but not a sharp one.

Click to enlarge
click image to enlarge

Creating the iris procedurally

You could also create the Iris using a gradient shader. Within the shader you are able to set the number of colours, the spread and even blend the boundaries of each colour with a fractal. By utlising a 'mix node' you could then blend other gradient nodes to create a more complex looking iris.


click image to enlarge

In this example we have two gradients nodes; there colours are being controlled by a number of fractals, each with their own colour and texture repeats; (found under the fractals property page>Advanced>Repeats) scaled to give a 'streaky' effect eminating from the centre of the iris to the outer radius. You can download the preset here to have a closer look (no pun intended).

One of the most important things to remember is the texture projection given to the fractals, so that the texture looks correct. As a guide, this is the way I approached the projection.


Image 1


Image 2

The 2 images above illustrate the kind of texture projection I wanted to achieve, all the points associated with the inner radius of the iris (labelled '1') needed to be placed on one side in the texture editor and all the points found on the outer radius should be located on the other (labelled 2). I found that a 'Texture_Projection (Explicit UVWs)' projection gave me the closest fit. I then used the various tools in the texture editor to place the points as shown in image 2. I now have the ability to scale the UV's in a direction that will give me the streaky lines as shown in image 1, i.e. from edge 1 to 2. This was done by simply scaling the repeats of the fractal in one of the axis.

The Cornea

The cornea should be almost completely Transparent, with a slight index of refraction (1.06) and should have the same reflection and specular settings as the white part of the eye, so that the appears to be seamless. In my shader however, the specular is 200 rather than 400, and have no incidence shader driving the reflection. This is personal preference, play about with the parameters until your happy.

 

Click to enlarge
click imageto enlarge

 

Lighting

Possibly the most important aspect of creating the eye is lighting. You need to create specular highlights, and for to that you need lights! You may need up to 3 lights to get the right effect, but that may cause too much light in the scene, so make the eye components associated models to each light. You'll find this feature under the lights properties in the Explorer (remember to make the lights inclusive in it's property page and to be more efficient, you could make them only contribute specular light).

 

Animating the eyeballs

When considering how the eye will move, we need to take into account two features:

1) Both eyes need to be moved using a single object.

2) The Eyes should also be able to be moved individually.

First of start by parenting all the eye components under the 'White_eye' mesh. Then create a null and go to Transform>Match All Transforms in the Transform Panel and select the 'white_eye' mesh. The null will shoot off to the center of the the chosen mesh. Because the null is, in effect, at the same pivot point as the 'white_eye' mesh, we can now parent all the eye components under this null, and keep the same center. Name the null 'right_eye_nullifier'.

Duplicate this null and move it outwards a few units so that it sits in front of the eye's pupil. Name the null 'right_eye_controll'. Select the 'right_eye_nullifier' null and go to Constrain>Direction in the Main Command Area. You are prompted to pick an object, so pick the 'right_eye_control' and right click to end picking. A Direction constraint property page will pop up. If you find that the eyeball is facing the wrong way, then you need to change the axis that the eye is aligned to. Do this within this page, by inputting 0 in the axis you do not want it aligned, and a 1 in the text field that u do. You can also use -1 if u need to flip the constraint.

 

Duplicate this eye, and rename each component so that it begins with 'left' instead of 'right'. Move the new eye a few units to the left of the other eyeball and you should notice that we have also duplicated the directional constraint , which means the second eye's direction is actually constrained to the wrong null. Therefore we need to remove this constraint and reapply it to the new controller. Pick the 'left_eye_nullifier' and in the Transform panel, go to Selection>Kinematics>constraints and select the direction constraint icon. Press delete and the constraint should be removed. You could also have selected the null and gone to Constrain>Remove All Constraintsin the constrain panel. You will now need to reapply the constraint on to the 'left_eye_nullifier' in the same manner as we did for the right eye.

We now have the ability to individually animate the eyeballs. To animate both control nulls at the same time, all we have to do is create a null, position it in the center of the first two control nulls and name it 'eye_master_control'. Then parent the 'right_eye_control' and 'left_eye_control' nulls under the master one, so that when we branch select the 'eye_master_control', the other two control objects are selected as well.

 

Should you want to create a more cartoon eye, one that was more egg shaped and catered for squash and stretch, then you could easily deform the eye components via a Lattice. This is the approach I had taken when creating Tooky's eyes. Simply select all the eye components in Branch mode, and go to Get>Primimitive>Lattice. The Lattice can now be deformed by tagging points and storing shape keys, which in turn deforms the shape of the eye components. Also, The eye setup for scaling the Iris and pupil still works perfectly.

Thanks to Miles Green for help on the Iris fractals!

Any questions, please freel free to contact me

Saf :0)

saf@onionboy.co.uk or sefstathiou@bournemouth.ac.uk

 

<<<<<<<< Back to part 1