Apple Shake 4 User Manual

Page 916

Advertising
background image

916

Chapter 30

Installing and Creating Macros

The LumaKey node is used to extract only the highlights. The highlights are blurred,
and then applied back on the original image with the Screen node, which is nice for
glows and reflections. The Mix node is used to control how much of the original image
shows through. The example image shows the original image on the left, and the
macro results on the right.

The following are the nodes reformatted as a macro. The macro parameters are bold.

image SoftGlow(
image In=0,
float blur=0,
float lowClip=.3,
float hiClip=.9,
float percent=100
)
{
LumaKey1 = LumaKey(In, lowClip, hiClip, 0, 0, 1);
Blur1 = Blur(LumaKey1, blur, xPixels, 0, “gauss”, xFilter,

“rgba”);

Screen1 = Screen(In, Blur1, 1);
Mix1 = Mix(In, Screen1, 1, percent, “rgba”);
return Mix1;
}

The macro name is SoftGlow, and it outputs an image (line 1). The parameters are
expecting one image input named In (line 2). This gives you one input at the top of the
node. If you want two image inputs, there would be two image parameters, and so on.
The other values are all float, controlling the macro settings (lines 3-6). These are
assembled in the macro body, and the return statement indicates that Mix1 is output.
The low and hiClip parameters determine the levels of the highlights.

If you save this into a startup .h file, for example, $HOME/nreal/include/startup/
SoftGlow.h
, it is immediately available on the command line. You can also find a copy of
this called SoftGlow.h in doc/html/cook/macros.

Photo courtesy of Photron

Advertising