UNIVERSAL HUMAN
EYE SHADER DOCUMENTATION
For instructions on adding the pre-made Eye Texture images, see the Eye Textures documentation.
By default the shader will render pink until textures have been added to the Image Texture nodes. You can use it without textures by disconnecting the Image Texture nodes and setting Albedo Mix to 0.0, however many of the parameters will have no effect.
Appending the Eye Materials to a Universal Human Rig/Base Mesh
Load the rig or base mesh into Blender.
Switch the Render Engine to Cycles
Append the Eyeball, Iris and Pupil materials (File > Append, and navigate to Eye Shader.blend > Materials). Blender 2.79 users should append from Eye Shader 2.79.blend.
Select the Eye L object and open the Shader Editor.
Select all and delete.
Click the "Browse Material to be Linked" button in the header and select the newly appended Eyeball material.
Select all the nodes, copy them, reselect the original Eyeball material in the header and paste the nodes.
Select the Iris object and repeat steps 4-6 for the Iris and Pupil materials.
The eye will appear pink by default, as there are no textures added to the Image Texture nodes. For instructions on adding the separately available Eye Texture images, see the Eye Textures documentation. To make your own, see the Creating Textures page. To use the shader without textures, unplug the Image Texture nodes.
To append the materials to versions of the Face Rig or Body & Face Rig that are older than 2.1.0, you will first need to follow the Eye Upgrade Procedure.
Using the Included Eye Base Mesh
The Eye Shader file contains external and internal eye models (to which the eye materials are applied), so they can be used independently of the Universal Human rigs and meshes. These are the same eye objects as those included with the rigs/base meshes.
The Iris includes two shape keys:
Pupil: Positive values dilate the pupil, negative ones constrict it.
Pupil Offset: Positions the pupil slightly off centre (normally upwards and in towards the nose). For the left eye you can leave this set to 1.0. For the right eye, either mirror the shape key (Shape Keys Specials menu > Mirror Shape Key) or rotate the Iris or Eye object 90° on its local Y axis.
Nodes Overview
The Eye Shader consists of three materials: Eyeball, Iris, and Pupil. The Eyeball material, which encompasses the sclera and cornea, belongs to the exterior Eye object. The Iris and pupil materials belong to the interior Iris object.
The Iris node's colour properties are stacked like layers, whereby the Melanin overlays the Fibres, which in turn overlay a Base colour. The Pupil material is shaded red by default, to simulate the red-eye effect caused by flash photography. To disable red-eye, change the Pupil material's Glossy BSDF colour to black.
If you're using an iris photo, load it into the Image Texture connected to the Fibres socket and set the Limbal Ring, Melanin and Grain to 0, and the Fibres Mix to 1.0. You can use the same image to generate the displacement/bump by connecting its Color output to the Displacement Image input, and adjusting the Displacement amount to suit.
Eye Node Inputs & Properties
Albedo Mix
The opacity of the Sclera Albedo texture image.
Hue & Saturation
The Hue/Saturation of the Sclera Albedo image. The value can be set using the Tint value slider.
Tint
Adds a colour tint to the Sclera Albedo image. White = no tint.
Base
This is like an undercoat for the Sclera Albedo image. Lower Albedo Mix values reveal more of the base colour.
Displacement
Adjusts the intensity of the Displacement image.
Albedo Image
Input for the Sclera Albedo texture image.
Displacement Image
Input for the Iris Displacement image.
Eye Node Outputs
Shader
Connects to the Material Output node's Surface input socket.
Displacement
Connects to the Material Output node's Displacement input socket.
Customising the Sclera & Cornea Node Group
Refer to the Eyeball Shader Reference.pdf file included in the Eye Shader folder for annotations on the inner workings of the node groups.
Iris Node Inputs & Properties
Limbal Ring
The opacity of the pigment encircling the iris.
Melanin Image
Input for the Iris Melanin texture image. If left unconnected, this will function as a slider which selects a flat colour from the melanin ColorRamp (see below).
Melanin
The opacity of the Iris Melanin image/colour.
Hue, Saturation and Value
The HSV of the Iris Melanin image. For finer control over the melanin, Tab into the node group and edit the colour/position of the colour stops in the Melanin ColorRamp node.
Fibres Image & Alpha
Input for the Iris Fibres texture image and alpha channel. Use this as the input for the main albedo image (e.g. if you're using an iris photo).
Fibres Mix
The opacity of the Iris Fibres image.
Grain
Adds a procedural texture to simulate finer, more random fibres. Set this to 0 when using an iris photo.
Hue & Saturation
The Hue/Saturation of the Iris Fibres image. The value can be set using the Tint value slider.
Tint
Adds a colour tint to the Iris Fibres image. White = no tint.
Base
This is like an undercoat for the Iris Fibres image. The selected colour fills in the transparent areas defined by the Alpha channel (if present). If you're using an Iris Fibres image without an alpha channel, setting the Fibres Mix to 1.0 will completely obscure the Base colour.
Displacement Image
Input for the Iris Displacement image.
Displacement
Adjusts the intensity of the Displacement image.
UV Map
Input for the UV Map node.
Iris Node Outputs
Shader
Connects to the Material Output node's Surface input socket.
Displacement
Connects to the Material Output node's Displacement input socket.
Customising the Iris Node Group
Refer to the Iris Shader Reference.pdf included in the Eye Shader folder for annotations on the inner workings of the Iris node group.
Rendering
The combination of reflection, refraction, caustics, SSS and a gradient transition from opaque material to glass makes for a worst case scenario as far as render times are concerned. Caustics take the longest to process, however this can be significantly mitigated by enabling Path Guiding in Blender 3.4 and above. While Shadow Caustics are even faster, unfortunately they deliver poor results.
A few other ways to accelerate caustics rendering are as follows:
Use larger lights (at the expense of softer caustics).
Double the render resolution and then scale the rendered image back down, which can yield more detail than rendering at the final output res for the same duration.
Disable Subsurface Scattering if its effect is negligible (which will depend on the darkness of the iris, camera proximity to the iris and key light position and intensity).
Note that the iris will initially appear much darker when using caustics (especially with denoising), and can take hundreds of samples to reach full illumination.
If render times are too high, it may be preferable to disable caustics - in fact sometimes this can produce more desirable results. Although this will alter the light path and reduce the illumination of the iris, it can be compensated for by repositioning the light and increasing the Melanin Value and the Tint and Base Values (note that higher values than 1.0 can be entered in the Value fields).
For more rendering tips, see the Rendering section in the Eye Textures documentation.