About Transformations and Motion Blur

About Transformations

Shake has a wide variety of transformations. Resolution changes are also included in the transforms. You can perform pans, rotates, scales, and shears, as well as cornerpinning (4-corner warping). Since all of these are linear operations, you can apply motion blur if the parameters are animated. There is a table at the end of this page explaining the different scaling transformations.

The Move2D command is the most flexible operator, since it basically 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.

Like color corrections, adjacent transformations are concatenated. This means 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 will figure out the combined transformation, and calculate 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 twenty times in a different compositor to see what the destructive effects are of repetitive filtering. Like the color corrections, this only occurs with adjacent transformations. See below for an example of using concatenation to your advantage.

Keep in mind that Shake has an infinite workspace. This means that effects won't get clipped when you move them out of frame and back in again with a second operation. To see more about how this can aid you, jump to About the Infinite Workspace.

For information on the on-screen controls in the GUI, jump to the GUI Manual's section about On-screen Controls



Concatenation of Transformations

Most of the transformations will concatenate together, similar to the way color corrections concatenate. This means you can put a Move2D followed by a Rotate and a CornerPin, and all three nodes will be resolved by exectuting the three moves simultaneously. This means that not only is the render faster, but also a much higher quality, since it only filters the image once, and not three times. This concatenation, like that occuring with color corrections, only takes place when the transform nodes do not have non-concatenating nodes placed in between them. For example, you couldn't 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 together:

Move2D
Move3D
Pan
Rotate
Scale
Shear
CornerPin
CameraShake



Inverting Transformations

Move2D and CornerPin each have an inverseTransform switch. This will invert the transformation, so that, 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 if you have imported tracking data to turn it into stabilization data. In the case of CornerPin, you declare if you want the four corners to go to four arbitrary points (i.e., pin an image into a second image of a TV screen), or the other way (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

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

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, i.e., 0,0,width,height, Crop is used to break the infinite workspace, and reset the color beyond the frame to black.
Crop
33,33,67,67
 
Window
-33,-33,
166,166
Window is identical to Crop, except you give 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
This is used to limit the calculation area of the tree to within the Domain of Definition, speeding 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

If a transformation parameter is animated, you can apply motion blur. 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 will either adjust the existing values or replace them, depending on how you declare them. This allows you to set each node individually, and then turn them all off easily just by changing the Global motionBlur switch to 0.

You can control the quality of the blur (0 = no blur, .5 is good, 1 is excellent, and higher is even better). You can also control the duration of the blur with shutterTiming. By default, it goes from the current from to the next frame, a value of 1, or 360 degrees of camera shutter. Real-world film cameras tend to have a shutter of about 180 degrees, or a value of .5 frames. You can also control at what frame the shutter opening is considered to start with the shutterOffset, which is 0 by default, meaning it starts at the current frame and calculates the motion occurring up until the next frame. By setting it to -1, you calculate all of the motion from the previous frame up to the current frame. If you put in a value of -time+1, and setting shutterTiming to time, it would always calculate the motion from frame 1 to the current frame. Looks cool.

When transformations are concatenated, the higher blur settings are used.

Sometimes, the where to place your Move2D nodes is a little counterintuitive due to the concatenation of transformations. Unfortunately (although we are looking into this), concatenations do not happen past any non-transformation node. For example, an Over node placed between two Move2D nodes will break it. To get around this, you should do your Move2D's first, and then composite. Here is why it is counterintuitive:

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

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

When you apply the motion blur, however, the result is inaccurate, because SpinWheel is applying the blur for the turning wheel, and then three nodes later, MoveCar is applying the blur to the already blurred wheels. We can't see the individual paths of the color dots on the wheels, just a horizontal smear.

This is WheelsOverCar, right before the entire car is panned. You can see why the result is bad, since the blurred wheels get blurred without consideration of the forward momentum added in a later node.

To correct this, it is actually more efficient to apply three Move2D nodes to pan all three elements separately, and then comp them all together. Here is the tree. MoveCar1, 2, and 3 are all identical, with 2 and 3 linked up to MoveCar1:

Because SpinWheel and MoveCar1 are both transformations, these get concatenated together. SpinWheel, PositionFrontWheel and MoveCar2 also get concatenated together. We there for end up with three transformations total, the same amount as our previous tree. However, look at the result, and you can see the path of the points on the wheels, giving an accurate blur:



Applying a Smear Effect

To get motion blur on non-transformed elements, you can apply a smear effect with Move2D by using the useReference 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 will swing 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