|
Create
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
ourselves:
1. Launch
Maya and create your surface for use, don’t forget to throw in a few
lights for test rendering.
2. Start
your surfacing of the object with a surface shader and assign it to your
object.
3. Create
a lambert. This will act as the ink
outline, so set it to black.
4. Create
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
explanations.
5. Create
a sampler info utility. Link your
sampler info’s facing ratio to the first term of the condition.
6. Create
a blinn.
7. Create
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.
8. Create
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).
9. Connect
the clamp output R to the vCoord of the ramp, to drive the highlighting
area appropriately.
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/
- 1545
Some
Quick Examples:
<=- click to enlarge
<=- click to enlarge
==========================================================================================================================
Author: TJ Galda, © 2002
All rights reserved.
Author takes no responsibility for any use of this document
whatsoever.
|