Using the clipmode parameter of layer nodes, Compositing math overview – Apple Shake 4 User Manual
Page 452

452
Chapter 16
Compositing With Layer Nodes
•
Rule Number 1: Only color correct unpremultiplied images. To unpremultiply an
image, use the Color–MDiv node.
•
Rule Number 2: Only apply Filter and Transform nodes to premultiplied images. To
premultiply an image, use the Color–MMult node.
For more detailed information on premultiplication, see “
Using the clipMode Parameter of Layer Nodes
You can easily composite elements of any resolution. To set the output resolution of a
composite that contains images of multiple resolutions, go to the compositing node’s
parameters and use the clipMode button to toggle between foreground or background
(as the output resolution). This applies to all layering commands. An element
composited over a differently sized background is one way to set your output
resolution. For more information on setting resolution, see Chapter 3, “
Compositing Math Overview
If Shake had only one layer node, it would have to be LayerX, since it can be used to
mimic all of the other compositing nodes. The math for most of the operators is
included in this node, both in general notation and in LayerX syntax. The LayerX syntax
has expressions for each channel.
The following table provides a quick reference to the Shake layer nodes and their
common uses, math, and LayerX syntax. For specific node descriptions, see “
Layer Node
Common Uses
Math
LayerX Syntax
Atop
Add effects to
foreground elements,
like smoke over a CG
character to match the
background.
A*Ba+(B*(1-Aa))
r2+(r*a*a2)
or
(a2==0 ||
(r2==0 && g2==0
&& b2==0 && a2==0) ?
r2 : (a2*r+(1-
a2*a)*r2))
Common
Create difference masks.
IAdd
Add fire effects, adding
mattes together.
A+B
r+r2
IDiv
A/B
r2==0?1:r/r2
IMult
Mask elements.
A*B
r*r2
Inside
Mask elements.
A*Ba
r*a2
Interlace
Interlace two images,
pulling one field from
one image, and the
second field from the
other image.