Applying
Shaders
In Houdini,
shaders are applied to objects using Shader operators (SHOPS). A
Shader operator is created by either writing VEX code or using Houdini's
VEX builder.
Shader operators
can be assigned to surfaces and controlled using parameters that
were written into the code and published up to the SHOP for artists
to control. Houdini has a number of default SHOPs available either
inside Houdini or from the Shader
Palette.
To follow through
this lesson, the following start file should be used. This file
contains three objects, lights and a camera. When it first loads,
make sure that the Viewer pane is looking through the main_camera.
1.
Set your Desktop
Select Desktops
> VEX_builder. From the Viewer pane menu,
select Network > Shaders (SHOP).
2.
Create a Shader in a SHOP network
Press
tab > VEX Standard > VX Plastic. This
is a basic shader with a few parameters available. In the Parameter
pane, change the Diffuse
color by clicking on the color swatch then entering the color in
the Color palette.

3.
Assign the Shader using Drag and Drop
LMB-Drag
the shader operator node from the Network pane onto the sphere.
This assigns it to the chosen object.

4.
Assign Shaders from the Palette
Select Tools
> Shader Palette... From just below the path
name, select Jump > $HFS/houdini/shop/palette.
This takes you to the default shader library that is installed with
Houdini. Click on Metals.
From this palette, LMB-drag one
of the metals onto the vase. This shader also has
parameters that let the artist make decisions about its look.

Note:
This shader was originally built using a VOP network. If you want
to see the VEX operator network that was used to generate the code
for this shader, then RMB-click on the shader in the Network pane
and select Edit Vop Network...
You will learn about working with VEX operator networks in the VEX
builder lessons.
5.
Apply a Shader at the Geometry Level
Go Up
in the Shader palette then select the stone
category. LMB-drag
a brick shader onto the ground plane object.
Next, LMB-drag
a different kind of stone into the Network pane. This will add it
to your scene without assigning it to anything. In the Network pane,
select Network > Objects.
Select the plane object and press i
to go to the geometry level.
In the Viewer
pane, press tab > Material >
Shader. Click on some of the polygons under
the objects and RMB-click
to accept. In the Parameter pane, click on the [+]
button next to Surface
and from the tree view, select the new stone.

Note:
The
Shader SOP lets you apply different shaders to parts
of a complex model. This is especially important when a model is
made up of many distinct shapes that have been merged at the Geometry
(SOP) level.
6.
Test Render the shot
Create a Test
rendering to see the results.
Here you can
see the two shaders on the ground plane. Note that the Monkey reflection
in the vase is based on the Mandril.pic reflection
map assigned to the metal shader. You will likely want to change
this for a proper environment map.

Conclusion
Shader Operators
can be assigned to objects and to parts of objects. They provide
parameters for artists to control the shader without having to worry
about the complexities of the shading network. These parameters
can also be keyframed to create animated shaders.
|