Tutorial: Setting up an Eyeball with real-time shaders.
For this tutorial you will be using the existing textures and geometry to setup an Eyeball with normal maps so that it appears to have much more detail than the underlying geometry. I used MAYA to create the Eyeball and to setup the shaders but many 3D Packages such as 3D Studio MAX also enable you to do the same things. The technique outlined is commonly used in today’s video games to make more realistic characters and environments.
To begin download the textures and Geometry here: http://www.turbosquid.com/3d-models/3d-model-real-time-eyeball/568827
To begin, import the following files into the 3d package of your choice:
Cornea.obj
Eyeball.obj.obj
Pupil.obj
Part 1 : The Eyeball.
First create a “Blinn” type Shader and call it “Eyeball.” The reason we are using “Blinn” is that the specula highlights will show off details from the normal map better.
Now we will plug in the normal map. Create a 2d texture file and then use your connection editor connect the Normal map using the following settings:
For OUTPUT S, set to “OutColor” and for INPUTS, set to “normalCamera”
Now for the 2d Texture File, load the following texture: Eyeball_normal.jpeg
( For Maya click frame the eyeball shader in the work area of the Hypershade, then right click next to it and chose “Create – 2d texture file.” Then Middle Click the New 2d Texture file and drag to the Eyeball Shader. Chose “Other” from the “Connection Input” Menu. Then Set Output and input as described above.)
Set your render to “HARDWARE” and the Quality settings to “HIGH QUALITY,” and you should now see the effects of the normal map on the model.
Now for some color. Load the following texture into the diffuse color channel of the Eyeball Shader:
Eyeball_color.JPEG
Finally load “Eyeball_spec.JPEG” into the Specular Color Channel for a more realistic spec response.
Part 2: The Cornea
For the Final part we will create the Cornea Layer which is a transparent layer that will wrap around the eyeball creating nice highlights and giving the Eyeball a wet feeling.
Just as you did with the Eyeball create another Blinn Shader and call it “Cornea.”
Repeat the steps used to create the Normal Map Node for the Eyeball and plug it into the Cornea Shader. This time use the following texture file: cornea_normal.JPEG
Set the TRANSPARENCEY of the Cornea Shader to fully transparent. Now only the specular highlights will render on the Eyeball.
Part 3: The Pupil
This parts easy and kind of neat. It turns out it can be tricky getting the pupil to say render a nice deep black. Here's the trick: First create a flat Lambert shader. Set it's color to absolute black. Next, set the Incandesance to full bright so that the shader glows white, but NOW set the color of the incanedscence to black also. It will now glow black ! Apply this shader to the "Pupil" geometry which rests inside the eyeball.
You’re pretty much done BUT for bonus points you may choose to add a ramp shader to the Eyeball to give it a fleshier feel. To do this select “Ambient Color” and chose “RAMP” for the texture type. Make a simple gradient from one color to the next. Set the Light value at Grey. And the Dark value at a deep red – pretty desaturated though, Try it out!
|