hs_velvet.mel |
The hs_velvet.mel is a script that creates a velvet kind of layer. To execute it, first source the script by typing in the script editor: source hs_velvet.mel In
order to make it work correctly, you need to select your shader (whatever
shader type you want: blinn, phong, phongE, lambert, ...) and type in
the script editor: hs_velvet. The script creates 2 surfaceShader: the velvet (with xtras attributes to control it) and a top_velvet_layer (which is applied instead of your original shader) If you have more than one shader, you'll have to re-execute the script for each shader, but the velvet shader will not be duplicated, the scripts will re-connect what's needed.
How it works? - The velvet layer is in fact
a surfaceShader which is on top of the shading network. * Color: is just the
color of the surfaceShader. Modify it as you want. Now you know how to control, let's see how you set the velvet in your scene. During
the script process, a directional light is created. Actually it's a dummy
light (intensity 0 and color 0 0 0). So, select the directional light called backLight (the shape), and orient it to 'fit' with your keyLight. (you can orient-constrain the backLight to your keyLight) You'll see the orientation of the velvet changing. The
dummy light casts shadows. This is to prevent from having some velvet
in a supposed to be in shadow area. This is done with the lightShadowFraction
attribute. So each time you change the dummy light's orientation, update
the shadows in IPR (if you use IPR). Here you can see before and after applying the velvet script to a shader.
Limitations: - If you select
a shader not assigned to a surface, you'll get the following error message: - If you have bad results with the velvet, try to check off the cast shadow attribute of the dummy light. |
hs_velvet.mel - (c) Emmanuel Campin - April 3rd 2001 |