Shake and Tremor Intermediate Tutorials |
This tutorial picks up at the spine-tinglingly riveting end of the Basic Tutorial, and adds a bit of complexity to the lesson. It discusses (OK, "discuss" means it blathers on for hours) color correction, premultiplication, optimization, motion blur, and the Time View.
This section introduces you to the Time View, where clips are viewed in time. To start, you need some additional elements.
Continue with the script from the Basic Tutorial, or lazily drift up to
the Load button
and load the script in <ShakeDir>/doc/pix/vp/vanilla1.shk.
In the Image tab, click FileIn and read in <ShakeDir>/doc/pix/VP/bg/cloud.sgi
and VP/shadows/shadows.1-56#.iff .
shadows (sequence) | cloud.sgi |
![]() |
![]() |
Note: You can use the left and right arrows to move forward and backward one frame at a time.
Notice that the smoke is out of sync with Vanilla, and starts one frame too
late. (Honestly, this wasn't set up to be cute, it was just one of those happy
accidents...).
You can select nodes in the Node View or the Time View. You
can view nodes, load parameters, or ignore nodes by clicking on the buttons
on each clip in the Time View. Activate the Select Group toggle to
load only the active nodes into the Time View.
|
Out of sync | In sync |
![]() |
![]() |
In the Node View, position the cursor over the shadows node and look at the help window (in the lower right of the interface). Notice that the channel type is BW (Black and White)there is only one channel in the image. This becomes significant in Section 7 Applying Vanilla's Shadow, but for now, note that because it is only one channel, it uses less disk space and loads faster than a 3-channel RGB image. To optimize your projects, you can save your black-and-white images as 1-channel images.
Apply a Color - Monochrome node to the FileIn.
You do not need to save the tutorials images as 1-channel images (it has already been done for youfancy that).
Note: Many compositing and paint packages do not support 1-channel images, so test your pipeline before throwing yourself into battle.
You can also easily make monochrome images with the command line:
shake myRGBimage.#.iff -mono -fo myBWimage.#.iff -t startFrame-endFrame -v
If this makes no sense, check the Command line documentation.
A powerful optimization step to take early in the compositing process is the glorious, enemy-crushing trick is to designate a Domain of Definition (DOD). It reduces rendering time, reduces I/O activity and reduces memory use. The DOD is a rectangular region around an element that defines the important part of the image, that is, everything that is not pure black on the RGBA channels. For example, the vanilla image is mostly blackyou are only interested in Vanilla herself. Therefore, limit the Domain of Definition to indicate the fun bits of the image.
Select the vanilla FileIn node.
Insert a Transform - SetDOD node.
Ensure the onscreen controls are set to Always
(on), and that the DOD display toggle
is also on. This second button turns the display of the DOD and the frame
border on and off. It has no role in the processing of the image.
Drag the DOD corners or edges in the Viewer to frame Vanilla. This tells
the software to only be concerned with this smaller portion of the image.
The rest of the image is not loaded in. This reduces memory usage, I/O activity,
and processing time, both upstream and downstream of the SetDOD.
Isn't that swell?
vanilla | vanilla with DOD |
![]() |
![]() |
Since the clip is animated, you must animate the DOD as well.
Turn on the Autokey button in the Viewer
. When enabled, it sets a key. If you make a mistake, press the Delete
Key button
.
Go through the 56 frames, placing keyframes approximately
every 7 frames, following the animation. This illustration has keyframes
at frames 8, 15, 21, 28, 47, 51, 53, and 56. As you place keyframes, little
notches appear in the Time Bar to indicate a keyframe:
|
If you want to practice, the smoke and shadows nodes
are good candidates for SetDOD nodes. This step is not necessary for
the tutorial, but is recommended for production.
For more information on the DOD, jump to Overview - Domain of Definition.
To examine motion blur, you need some motion. In the real Vanilla Pudding shot, a dark cloud shoots quickly in as Vanilla amps up her anger. Wild Brain has a cool cell animation for the effect, but then, you wouldn't be able to examine motion blur, and you'd also have to download another 10 MB of data. In this lesson, animate the position of the cloud.sgi still image.
Select the Layer3 node and attach a Layer - Layer node.
Connect the cloud node to the second input of Layer5.
Because the Layer nodes are beginning to stack up, rename Layer5 to Over_Cloud.
To rename a node:
In the Parameters1 tab, the first parameter is nodeName.
To name nodes, do not use spaces, funny characters, or node types, like Blur, since there is already a Blur node in the Shake toolset.
The next step is to move the cloud. In the first tutorial, you used a Move3D to pan the hill. To help modify the shape of the cloud and add a bit of perspective, use a CornerPin node.
Vanilla's expression changes from curiosity to anger from frames 30 to 37. Move the dark clouds to support her animation.
frame 37 |
![]() |
Go to frame 30.
Frame 30 |
![]() |
The cloud is animated over 7 frames.
The Transform nodes Move2D, Move3D, CornerPin,
CameraShake, Pan, Rotate, Scale, Stabilize,
and MatchMove all have motion blur parameters. There are three parameters
to motion blur: motionBlur, shutterTiming, and shutterOffset.
shutterTiming and shutterOffset are tucked under the motionBlur
subtree.
OK, not being shy at all here, the motion blur in Shake is mighty swank. Rather than render several in-between images and average them together (which, let's face it, is pretty lame), Shake tracks each pixel through the transformation.
motionBlur= 0 | motionBlut = 1 |
![]() |
![]() |
The motionBlur parameter controls the quality level. When set to 0, the blur is turned off. When set to 1, the blur is high quality. For an approximation andto decrease your render time, drop it down to .5 (for acceptable), and .1 (for test level).
motionBlur = .5 | motionBlur = .1 |
![]() |
![]() |
The shutterTiming parameter specifies the fraction of the frame exposed for the motion blur. For example, the default .5 setting indicates that only half of the frame of movement is exposed. This is the default since a film camera has a shutter exposure of around 178 degrees out of 360, so it is rounded off to .5 (You can also enter 178/360 to be exact, but nobody likes a smart aleck). If you set shutterTiming to 0, motion blur is turned off. If you set it to 1, the entire frame is calculated. You can also set this number beyond 1 to calculate later movement into the current frame. Therefore, to attempt to match a video camera with a shutter setting of 1/300, enter 1/300 in the shutterTiming parameter, and it resolves the setting to .0033, or not much blur at all.
Adjust the shutterTiming to1.5
shutterTiming = .5 | shutterTiming = 1.5 |
![]() |
![]() |
The last motion blur parameter is shutterOffset. This controls the beginning point in time, relative to the start of the frame, that the motion is calculated. By default, shutterOffset is set to 0, so Shake calculates the motion from the start of the frame. When set to -.5, it calculates the motion from the previous half frame of movement. This can often be useful when adjusting motion blur for RotoShapes.
Set shutterOffset to -.5.
Return shutterOffset to 0.
shutterOffset = 0 | shutterOffset = -.5 |
![]() |
![]() |
Each transform node with enabled motion blur has settings that can be individually tuned. To turn off all motion blur settings, go to the Globals tab and locate the motion blur parameters. The first two parameters are multipliers of the node motion blur settings.Enter 0 in the Global motionBlur to internally multiply all other motionBlur settings by 0, and turn everything off. To return to the node's setting, set it to 1. Typically, you tune your motion blur and then set your Global motionBlur to 0 as you finish the rest of your script. When you are ready to render, reset your Global motionBlur value to 1.
Now that you have added the cloud, you can begin to consider the coloring. Vanilla Pudding has strong saturated colors, so you don't want to modify her. However, you can boost the color of the hill in the background to suggest atmosphere. ("Atmosphere" meaning the meteorological phenomenon, not the romantic staging practice.) You can then animate the color boost down when the cloud passes over.
Shake has many color correction nodes that are based mainly on its command-line heritage. Most of the color corrections are single-function nodes that apply a single mathematical operationadd, multiply, gamma function of color, etc. For the interface, you can also use a master color node which duplicates many of these nodes, deviously named ColorCorrect.
Although you can do lots of tricky clever things with the ColorCorrect node, only the Master Add parameters are used in this lesson. ColorCorrect can tune your RGB channels globally, or just in the dark areas, midtones or highlights, do manual curve adjustment, color replacement, channel inversion, reordering, and hue shifting. Doesn't that sound fun?
In the ColorCorrect parameters, click the Master Controls subtab.
In the Add parameter row, press the O (offset) key, and hold the Left Mouse down and drag to the right until the value is approximately .3.
Press the B (blue) key and drag slightly to add a some blue.
Master Add = 0, 0, 0 | Master Add = .29, .28, .34 |
![]() |
![]() |
The sky is boosted in brightness with the hill image. This occurs because you are color correcting a premultiplied element from a CG render. When you use the Over operation mode in a Layer node, you declare that the black areas in the RGB channels match the black areas in the mask channel. When the Add parameter is modified, the black levels are boosted, and so do not match the black areas of the alpha channel. That occurs when a premultiplied element is color corrected. This is bad. One of the ColorCorrect node's eight billion parameters allows you to easily correct this premultiplication problem with a button click or two.
Press to the Misc subtab.
Set preMultiplied to yes:
preMultiplied - off | preMultiplied - on |
![]() |
![]() |
Only the hill element is color corrected (and not the sky behind it).
This is good.
|
Animate the hill color correction so it darkens when the cloud passes over it.
Next to every parameter is a mini autokey button
allowing you to animate parameters.
Enable the autokey button
next to the Master Add color picker. When autokey is on and you
change a value, you create a keyframe. Therefore, you have just entered
a key at frame 31.
Go to frame 37.
Drop your Add values to 0, with perhaps a little red.
frame 31 | frame 37 |
![]() |
![]() |
This section introduces you to editing animation curves. These steps are not necessary for the tutorial, but demonstrates how to create an ease-in/ease-out on your curves.
In the Add parameter row, toggle the button that looks like a small clock
(Clock = Time = Curves. Get it?). A red check mark appears to indicate
the parameter is loaded
into the Curve Editor. This is automatically activated when the autokey
button is enabled.
Click the Curve Editor tab to view the animation curves.
Note: Press the Spacebar to expand the Curve Editor window. Press the Spacebar again to reset the Curve Editor window.
To remove a keyframe, select the keyframe and press Delete.
To break the tangents of a curve, Ctrl-click on a tangent end.
To join broken tangents, Shift-click on a tangent end.
This section discusses a practical solution to premultiplication problems and the concatenation of color corrections. To discuss color corrections without the ColorCorrect node, first do a small test (that has nothing to do with our final composite).
This problem occurs because, as with the hill, you have color corrected a premultiplied element and revealed artifacts.
The quick solution is to unpremultiply the element before color correcting, and then premultiply it again before you composite. This is done by bracketing the ContrastLum node between a Color - MDiv ("Mask Divide")node and a Color - MMult ("Mask Multiply") node. These should be used whenever you modify a premultiplied element (the black areas of the RGB equal the black areas of the Alpha in a premultiplied image).
Select the node (SetDOD) above ContrastLum1 and insert a Color - MDiv.
Select ContrastLum1 and insert a Color - MMult (not
Mult).
The edges are clean.
Again, why this solves the oh-so-simple-solution-to-an-oh-so-misunderstood
problem is mathematically elaborated in Overview
- Premultiplication.
The ContrastLum node on Vanilla is used as an example. To put this into practice, color correct the smoke element so it is not so bright and has some transparency.
Select MDiv1, ContrastLum1, and MMult1 in the Node View.
Press E to extract the nodes from the tree.
|
The next interesting aspect of color nodes is that the nodes
concatenate. What in blazes does concatenate mean? (Have a good time looking
up that word in your English - Nepalese translation dictionary.) Concatenation
collapses multiple mathematical equations into one operation. Concatenation
gives two primary benefits: Greater color integrity and faster processing.
For example, if you apply a Brightness node, which multiplies color,
with a value of 5, and then apply a second Brightness node of .2, they
cancel each other out, since RGB * 5 * .2 = RGB * 1. Without concatenation,
you end up with most of your image crunched down to a 20 percent value. Not
all color nodes concatenateonly the nodes that have a small yellow "C"
on the node icon in the tabs. The nodes with a red C (AdjustHSV and
LookupHSV) only concatenate with each other. So, for example, with
the 6 nodes in the following illustration, Brightness, Clamp,
Compress, and ContrastRGB can be placed in any order as many
times as necessary and they internally resolve into one operation. AdjustHSV
could only be lined up with itself or a LookupHSV.
|
Moving on to the impatient example:
Select only the ContrastLum1 node in the Node View.
In the Color tab, Ctrl-click on Fade. The ContrastLum node is replaced with a Fade node.
Bring the Fade value down to approximately .6 to add transparency.
Insert a Color - Add node after Fade1.
Next, use the Add node to boost the black levels on the smoke's outline.
Because the Fade and Add nodes concatenate, the
nodes are calculated in one pass, rather than two.
|
Now, what about those pesky MDiv/MMult nodes? Are they really
necessary? To find out, select both nodes and press I with the cursor
over the Node View to ignore those nodes.
Because an Add node is used, the blacks are boosted,
and the result is something like this.
This is bad.
Yup, guess you do need them.
|
|
The last step discusses two different strategies for working the shadow element onto the mid plate. The simple approach is discussed first.
The shadows element is a single channel black-and-white image with no alpha channel. Subtracting the shadows element from the mid element affects the RGB channels of mid but not the alpha. This is a good.
Select the mid node and attach yet another Layer node.
Rename the Layer node as ShadowSubtract (or some other clever name).
Connect the SetDOD node from shadows (if you created one
earlier, otherwise connect the shadows element directly) to the
second input of the ShadowSubtract (new Layer) node.
Apercentage slider appears when the operation is switched to ISub.
To save the script, press Ctrl-Shift+S (Save As), and name it vanilla2.shk (or something artistic that expresses the inner magical you).
The next possible way to apply the shadow is as mask to a color correction. Replace the ShadowSubtract node with a Brightness node.
Select ShadowSubtract in the Node View.
Ctrl-click on Color - Brightness. TheShadowSubtract node is swithced with a Brightness node.
Connect the output of the SetDOD1 (that is attached to shadows)
and connect it to the side input of Brightness1.
|
Drag the value slider in Brightness down to approximately .3. You are no doubt chagrined and humiliated to discover absolutely nothing happens. Because the mask takes the alpha channel of the mask input (SetDOD1 in this example) as the masking channel, nothing happens. If you recall, shadows only has a single black-and-white channel. Therefore, the mask is considered to be black, so there is no influence as a mask.
To set a mask channel other than Alpha, load the parameters of Brightness1.
Among the first is a parameter called Mask. If a mask is attached,
there is subtree plus sign .
Click the plus sign to reveal parameters that pertain to the mask.
Switch maskChannel to R, G, or B. Since SetDOD1 is a black-and-white
channel image, any channel (except Alpha) works.
In this case, the shadow is applied with the shadow as a mask to a color correction.
Use the side mask input in the following circumstances:
The masked node is not a Layer node or any other node reading in more than one input. The logic is completely backward from what you want.
You are using the mask just once in a chain.
You are not concerned about breaking color or transform concatenation.
If you use the same mask several times on connected nodes, you:
Slow down your render.
Break possible concatenation with transform or color nodes.
Corrupt the boundary between the masked and the non-masked area.
As an example, add blue to the shadow area with the Add node.
Select the Brightness1 node.
Insert a Color - Add node.
This is an example. Don't do this. This is naughty. |
![]() |
The brightened area is mixed with the non-brightened area, and then mixed with the brightened blue. Two mixing operations are calculated. Add and Brightness usually concatenate, but not here because it is broken by the mask inputs.
The work-around is to use the Layer - KeyMix node. This mixes two images through a third mask.
Select the mid node.
Shift-click on KeyMix. This shoots off a new branch instead of inserting KeyMix1 between mid and Brightness1.
Connect Add2 into the second input of KeyMix, and connectSetDOD1
into the third input of KeyMix1not the side mask input.
To disconnect the noodles to the mask inputs of Add2 and Brightness1,
either place the cursor over the noodles so they turn red and press the
Delete key, or select the Mask text fields of both nodes
and clear them of the word SetDOD1.
Instead do this. This will bring glory and fame |
![]() |
You have now created the shadow with a different technique. You can pile as many operations as you want on the Brightness1 - Add1 chain and have them efficiently mixed into just the shadow area.
To wrap this up, the two main compositing nodes are Over (or Layer with Over as its operation) and KeyMix.
Use Over when the first input has the mask you want to use. The image can be premultiplied or unpremultiplied. If unpremultiplied, you must enable preMultiply in the Over parameters.
Use KeyMix to mix two images through a mask, or when you are compositing foreground over background with a third image as the mask. The foreground must be unpremultiplied.
What is this critter talking about? Jump to Overview - Layering and Overview - Premultiplication.
To insert a node between two nodes, pick the parent node and click on the new node from the function tabs.
To create a new branch, select the parent, and Shift-click on the new node.
To replace a node, select the node to replace, and Ctrl-click on the new node:
To create a floating node, Ctrl+Shift-click on the node you want.
To extract a node from a tree, select the node and press E for Extract.
To delete nodes, select the nodes and press the Delete key.
To detach a noodle, Ctrl-click on the noodle or put the cursor over the noodle (it turns red) and press Delete.
|