User Guide > Composite > Workflow   

Creating a Custom Drop Shadow Tool

In this lesson, you will create a drop shadow using an existing clip as a starting point. This will involve some color correction, blurring and translation. At the end, you will turn the drop shadow operators into a subnet and publish it as a Digital Asset. This will make it easy to re-use in future composites.

This lesson will continue from where the Layering Clips lesson finished. You can load the following file to give you a clear starting point.

Load Start File

If necessary, select Network > Compositing (SOP) from the Viewer pane menu. Press i to go into img1.


1. Add a Transform COP

In the Network pane, MMB-click on the output of the butterfly operator and select Effects > Transform then click to place.

This operator is branching away from the original node. Click on the output of the xform COP and then click on the input of the layer COP. In the Parameter pane, move the xform operator up on the list so that it sits above butterfly. This means that it will be below butterfly in the composite.

2. Create the Shadow Effect

Select the xform operator and in the Parameter pane, set the Translate values to 0.025 and -0.025. These values are UV values as opposed to pixel values. The new butterfly is appearing from underneath the original.

RMB-click on the output of the xform operator and select Color > HSV then click to place. This operator is placed between the existing operators. Select the new hsv operator and click on the A button next to Plane Scope to focus the color shift on the RGB channels and not the Alpha channel.

Next, set Saturation Shift to 1 and Value Scale to 0. Now the shadow looks black.

3. Blur the Effect

RMB-click on the output of the xform operator and select Effects > Blur then click to place. This operator is placed between the existing operators. Select the new blur operator and set its Size to 35. Now the shadow has a softer look.

4. Make the Shadow Opacity

RMB-click on the output of the blur COP and select Color > Bright. This inserts a Bright COP in-between this operator and the layer operator.

In the Parameter pane, set the Plane Scope to A (alpha) by clicking on the R, G and B buttons to turn them off. This will make sure that the brightness setting is only affecting the incoming alpha.

Set Brightness to 0.66. The shadow is now semi-transparent. You can use this value to control the opacity of the shadow.

5. Create a Subnet

In the Network pane, select the four operators contributing to the drop shadow. Press Ctrl-RMB and select Collapse Selected into Subnet. Rename it drop_shadow.

6. Create a Custom Operator Type

RMB-click on the drop_shadow subnet and select Create Type From... Set the Operator Name to drop_shadow and the Operator Label to Drop Shadow. Set the Save to Library to $HOME/houdini6/OPcomposite.otl and click Accept.

In the Operator Type Properties panel, click on the Parameters tab. In the Network pane, go into the drop_shadow subnet and select the xform operator. From the Parameter pane, drag the Translate parameter name onto the Parameter list in the Operator Type Properties panel. Set its Label to Offset.

Next, click on the blur operator and drag the Size parameter name onto the Parameter list. Set its Label to Blur Size.

Next, click on the bright operator and drag the Brigntness parameter name onto the Parameter list. Set its Name to opacity and its Label to Opacity.

Click Accept. Click on the drop_shadow operator and the new parameters are available for editing.

7. Test the new tool

In the Network pane, MMB-click on the output of title and select Drop Shadow. Click to place a new branch that uses the drop_shadow operator. Re-link this into the layer operator and position it under the title on the list. If you want, change some of the drop_shadow parameters to control the shadow.

8. Render out the Results

In the Network pane, select Network > Outputs. Press tab > Generators > Composite. In the Parameter pane, set the COP name to layer1 then click the Render button to render to an mplay window. You can also set up the Output Picture to render out a sequence of images.


Re-using the Drop Shadow tool

When you created the Drop Shadow tool, it was put into the OPcomposite.otl Library and referenced into your Houdini (hip) file. When you start a new file this tool is no longer available. To access it, you must install the OPcomposite.otl Library using File > Install Operator Type Library...