Tuesday, April 26, 2011

Tips: Change the color of shadow with Houdini

Today we will use the powerfull shader of Houdini to change the color of the shadow.

So fist, create a Mantrasurface in the material palette and assign it to your object which will receive the shadow.

After that go to the SHOP level, double clic on your mantra surface to see the nodes of the shader. Add a "shadowMatte" node

We will use the alpha output of the node, that we will multiply with a color, so we have to convert the alpha ( Float ) to a vector ( like a color ) with the help of a "Float to vector" node. We will also create a "Multiply" node and connect the output of the "floattovec1" to the first input of the multiply node. For the second input of the multiply you'll middle clid and choose "Promote Parameter", a little circle beside the input is created.

Select this circle and in the parameters windows change the type to "Color" and rename it to "ShadowColor" (Name and label)



After that, create an "Add" node just after the "DifuseColor" output and plug the "multiply" ouput to the second input of the Add node :





Now you can use the shadow color ! For now, the parameter is in the bottom of the parameters of the shader to change that clic on the icon on top right and choose "Edit parameter interface"
 

 Move the parameter from the bottom of the list to where you want, for instance, in the "diffuse" folder :

 

 Now you can change the color of the shadow receveided by a object with its shader :