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.

Slipping Time Sync

This section introduces you to the Time View, where clips are viewed in time. To start, you need some additional elements.

shadows (sequence) cloud.sgi

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...).

To sync the smoke clip with the animation:

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.

Scaling and Panning the Time View: To scale and pan the Time View, use the standard Ctrl+middle mouse and middle mouse, respectively, moving the mouse in a left-and-right motion.

The smoke clip now starts one frame early. Normally, this isn't a problem, as the first frame of smoke is black. However, it disrupts the automatic calculation of the frame range. As a clean-up step, reset the clip to start at frame 1:

Out of sync In sync

Optimization

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.

To save a black-and-white image as a 1-channel image:

You do not need to save the tutorials images as 1-channel images (it has already been done for you—fancy 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 black—you are only interested in Vanilla herself. Therefore, limit the Domain of Definition to indicate the fun bits of the image.

To set the DOD:

vanilla vanilla with DOD

Since the clip is animated, you must animate the DOD as well.

Jumping to keyframes. To quickly jump to keyframes, use the Next or Previous Key buttons on the Time Bar, or use the Up and Down arrows on the keyboard.

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.

Motion Blur

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.

Because the Layer nodes are beginning to stack up, rename Layer5 to Over_Cloud.

To rename a node:

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

 

Frame 30

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.

To activate the motion blur:

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.

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.

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.

Color Correction with the ColorCorrect node

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 operation—add, 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?

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.

preMultiplied - off preMultiplied - on

Only the hill element is color corrected (and not the sky behind it).

This is good.

Premultiplication. Shake exposes control of premultiplication to ensure the user has control over premultiplication settings. This subject is at the heart of compositing. You are therefore strongly encouraged to read Overview - About Premulitplication for more information.

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.

frame 31 frame 37

Animation Curves

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.

To load and edit a parameter into the Curve Editor:

Note: Press the Spacebar to expand the Curve Editor window. Press the Spacebar again to reset the Curve Editor window.

Color Correction Using Other Nodes

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).

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.

Remembering Hot Keys. To remember hot keys, press the right mouse in the area—a contextual menu that lists all commands and their associated hot keys appears.

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 concatenate—only 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.

Concatenation and Float. Note that when working in float space, the concatenation restrictions disappear, since all nodes effectively concatenate.

Moving on to the impatient example:

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.

Breaking Concatenation: Inserting a side-input mask or non-concatenating node breaks concatenation, and results in inefficiencies and possible loss of image integrity. Try to avoid this.


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.

Fade and Premultiplication: Actually Fade doesn't need a MDiv/MMult coupling, because it affects the RGB and Alpha channels equally. However, if we placed it after MMult1 or before the MDiv1, it would break concatenation. This example opts for efficiency.

 

Setting Black and White Levels: The more efficient way to compress your black and white levels is to use the Color - Compress node. It sets your new low and high colors. The Fade/Add combination is used to show concatenation.

Applying Vanilla's Shadow

The last step discusses two different strategies for working the shadow element onto the mid plate. The simple approach is discussed first.

Shadow Method 1

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.

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).

Shadow Method 2

The next possible way to apply the shadow is as mask to a color correction. Replace the ShadowSubtract node with a Brightness node.

Mask Inputs: Although all nodes have a side mask input, you only get practical results from one-input nodes like Add, not multiple-input nodes like Layer. The internal logic is the opposite of what you expect for multiple-input nodes.

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:

If you use the same mask several times on connected nodes, you:

As an example, add blue to the shadow area with the 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.

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.

 

Different Ways to Insert Nodes into a Tree

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.