About Transformations and Motion Blur

About Transformations

Shake has a wide variety of transformations that also include resolution changes. You can pan, rotate, scale, and shear, as well as cornerpin (4-corner warping). These nodes are linear operations, so you can apply motion blur if the parameters are animated.

The Move2D node is the most flexible operator, since it covers most of the other transformations. There is no time difference in using a Move2D to pan an image or using the Pan to pan the image, since Pan is a macro of Move2D. However, if you use a single Move2D node, it will be more efficient than using a Pan, Rotate, and then Scale node, due to internal computations.

Shake has an infinite workspace. This means that effects won't get clipped when you move them in and out of framewith a second operation. For more information, jump to About the Infinite Workspace.

For information on the GUI on-screen controls, jump to Interface - On-screen Controls.



Concatenation of Transformations

Similar to the way color corrections concatenate, many of the transformations concatenate together. Like color corrections, adjacent transformations are concatenated. You can apply a Move2D then a Rotate and a CornerPin, and all three nodes are resolved by executing the three moves simultaneously. Not only is the render faster, but a much higher quality (since the image is filtered one time instead of three times). If you Rotate an image of the Earth so that the lit side faces the sun, and then take a second Rotate to orbit the Earth around the sun, Shake figures out the combined transformation, and calculates it in one pass. This is important because it means you spend, in this case, half of the processing time, and you only filter the image once, not twice. (Just for fun on a rainy day, try panning an image 20 times in a different compositor to see the destructive effects are of repetitive filtering.) Like the color corrections, this only occurs with adjacent transformations. See the section "About Motion Blur" for an example of using concatenation to your advantage.

This concatenation only takes place when the transform nodes have no non-concatenating nodes in between them. For example, you cannot place a Rotate, then an Over, then a Blur, and then a Move2D and have the Rotate and the Move2D concatenate.

The following nodes concatenate:

Move2D
Move3D
Pan
Rotate
Scale
Shear
CornerPin
CameraShake



Inverting Transformations

The Move2D and CornerPin nodes each have an inverseTransform switch. This inverts the transformation; for example, a pan of 100 becomes a pan of -100 . The parameters themselves don't change, just their effect. In the case of Move2D, you can use this the inverseTransform to turn imported tracking data into stabilization data. In the case of CornerPin, you declare the four corners to go to four arbitrary points (pin an image into a second image of a TV screen), or the inverse (extract what is on the TV screen into its own image). This second technique is also helpful for generating texture maps from photos for 3D renders.


Setting Output Resolution and Scaling Images

There are two types of scaling nodes that scale the size of the image in the frame, but don't change the actual resolution size (Scale, Move2D), and nodes that also change the resolution size (Resize, Zoom, Fit). Additionally, the Crop, Window, and ViewPort nodes can be used to change the image resolution by cutting into an image or expanding its borders. Finally, to confuse matters, the SetDOD function crops in an area of interest, called the Domain of Definition. These tables discuss the differences between the scaling functions:

Shake Function Changes
Resolution
Changes
Pixel Scale
Breaks Infinite Workspace Changes Relative Aspect Ratio
Scale,
Move2D
  Yes   Yes
Crop Yes   Yes  
Window Yes   Yes  
ViewPort Yes      
SetDOD     Yes  
Resize Yes Yes   Yes
Fit Yes Yes Yes  
Zoom Yes Yes   Yes

 

Shake Function Example Example Parameters Notes
Example Image
Resolution =
100x100 pixels
This is the unmodified image.
Scale,
Move2D
xScale = .5
yScale = .5
Scale is a sub-set of the Move2D function. There is no speed increase when using Scale instead of Move2D.
Scale,
Move2D

xScale = 1.6
yScale = 1.6

 
Crop
-33 ,-33,
133 ,133
When using default parameters, 0,0,width,height, Crop breaks the infinite workspace, and resets the color beyond the frame to black.
Crop
33, 33, 67, 67
 
Window
-33, -33,
166, 166
Window is identical to Crop, except you specify the output resolution in the third and fourth parameters.
Window

33, 33, 34, 34

 
ViewPort
33, 33, 67, 67
This is identical to Crop, except it does not cut off the Infinite Workspace, and is therefore primarily used to set a resolution.
SetDOD
33, 33, 67, 67
Used to limit the calculation area of the tree to within the Domain of Definition; speeds up renders considerably.
Resize
72, 48
 
Fit
72, 48
Fit and Resize are identical, except that Fit preserves the pixel aspect ratio, padding the edges with black.
Zoom
.72, .48
Zoom and Resize are identical, except that Zoom gives a scaling factor and Resize gives a resolution for its parameters.

 

About Motion Blur

A motion blur can be applied to an animated transformation parameter. Each transform node has its own motion blur settings, so you can tune each one individually. There is also a global set of motion blur parameters, which either adjusts the existing values or replaces them, depending on the parameter. You can set each node individually, and then turn them all off easily by changing the Global motionBlur switch to 0.

You can control the quality of the blur (0 is no blur, .5 is good, 1 is excellent, and higher is even better). To control the duration of the blur, use shutterTiming. By default, it goes from the current frame to halfway towards the next frame, a value of .5, or 180 degrees of camera shutter. Real world film cameras are at generally at 178 degrees. You can also control at what frame the shutter opening is considered to start with the shutterOffset. This value is 0 by default, so it starts at the current frame and calculates the motion that occurs up until the next frame. When set to -1, the motion from the previous frame up to the current frame is calculated. .

Concatenated transformations use the higher blur settings.

Sometimes, where the Move2D nodes are placed is a little counterintuitive due to the concatenation of transformations. Concatenations do not happen past any non-transformation node. For example, an Over node between two Move2D nodes breaks concatenation. To get around this, apply your Move2D's nodes, and then composite.

In this fine and photo-real example, two elements are composited together: A car body, and a single wheel. The wheel is used twice, once for the back wheel and once for the front wheel:

 

In the node tree, a Move2D node (named SpinWheel) rotates the wheel, so the node is animated. The PositionFrontWheel node is a non-animated Move2D to pan a copy of SpinWheel to the front wheel position. The two wheel nodes are comped together (RearWheelOverFront) and that is comped over the car body (WheelsOverCar). To animate the car forward, a Move2D node (MoveCar1) is applied, which simply pans the entire image right.

 

The result is inaccurate when the motion blur is applied because SpinWheel applys the blur for the turning wheel, and then three nodes later, MoveCar is applys the blur to the already blurred wheels. Instead of the individual paths of the color dots on the wheels, you only see a horizontal smear.

 

The following image is WheelsOverCar, right before the entire car is panned. The result is bad, since the blurred wheels are blurred without consideration of the forward momentum added in a later node.

 

To correct this, it is more efficient to apply three Move2D nodes to pan the three elements separately, and then comp them all together. In the following tree, MoveCar1, 2, and 3 are all identical, and 2 and 3 are linked to MoveCar1. This is easily done by copying MoveCar1 (Ctrl+C) and then cloning it with Ctrl+Shift+V. The link visualization is activated with Ctrl+E:

 

Because SpinWheel and MoveCar1 are transformations, these nodes concatenate together. SpinWheel, PositionFrontWheel and MoveCar2 also concatenate together. The result is three transformations, the same amount as the previous tree, but with an accurate blur on the wheels.



Applying a Smear Effect

To get motion blur on non-transformed elements, you can apply a smear effect using a Move2D nide by with the useReference parameter and setting the referenceFrame to time. For example, if you have rendered a clip of a swinging pendulum, locate the center of rotation, and the approximate rotation angle animation, and set your motion blur. If you play through it, the entire element swings out of frame because of the new animation. However, set useReference to 1, and the element remains static, but the blur is still applied as if it were moving. For a tutorial on this, jump to the Fan Tutorial.

frame 5
frame 12
frame 24