your own toon shader: How-to? (maya)
If you want to
create a toon shader using your new found knowledge, the simple way, you
can use my mel script. The beauty
of this script is it will create an interface to control your shading
network, but leave the network visible.
The benefit of that is you can pick apart the network and
understand how it is functioning.
You can get this script and other of my items on TurboSquid:
Ok, letís create
a simpler version than the tweaked out one generated from the script by
Maya and create your surface for use, donít forget to throw in a few
lights for test rendering.
your surfacing of the object with a surface shader and assign it to your
a lambert. This will act as the ink
outline, so set it to black.
a condition utility. Link your
lambert out colour rgb to the colour 2 rgb in the condition. Link your condition out colour to your
surface shader out colour. Set the
condition to greater than. The second
term will be our line thickness ratio, letís try 0.4 as in the above
a sampler info utility. Link your
sampler infoís facing ratio to the first term of the condition.
a clamp utility. Link your blinn
out colour to the input of the clamp.
Set all min values to 0 on the clamp, while itsí max values go to
1,0,0. This allows us todetermine
where to put the shadows and highlights, while clamping them to a value
range between 0 and 1.
a ramp. Set the ramp to V Ramp
with smooth interpolation. Remove
one colour so you only have two. The
ramp will be the paint colours.
The top being the brightest colour, and the bottom being where the
paint falls into shadow but is not yet outlined with black. Set up your two colours appropriately,
stacking them fairly close together (eg. at 0.385 and 0.190).
the clamp output R to the vCoord of the ramp, to drive the highlighting
10. Connect the out colour
of the ramp to the colour 1 rgb of the condition.
At this point, you
have created a rudimentary toon shader.
However, for more options and a better overall render, it is advised
to use the above mentioned script and tweak it for your scene. Again, you can find my script at: http://www.highend3d.com/maya/shaders/
<=- click to enlarge
<=- click to enlarge
Author: TJ Galda, © 2002
All rights reserved.
Author takes no responsibility for any use of this document