About the Domain of Definition (DOD)

The Domain of Definition

The DOD is a rectangular zone that Shake uses to optimize rendering speed by bounding the significant pixels in the image. Everything outside of the DOD is considered to be the background, meaning black by default, and can therefore be ignored in most computations. Proper handling of the DOD is an extremely powerful way of speeding up your render times.

As an example, create an Image - Text node. Once it is created, make sure the Display DOD button in the Viewer is turned on: . Looking at the text, you will see a green box bounding the letters, which is the DOD. Because of the DOD, nodes attached to this image will process in a fraction of the time it takes to calculate the same nodes on an image that fills the frame.

 

To test to see if I'm telling the truth or just smoking crack, attach a Filter - RBlur, and set the oRadius to 360. Now create an Image - Rand, which will create an entire frame of pixels. Attach a Color - Monochrome to turn it into a two channel image (The Text node creates a Black&White + Alpha image by default), copy RBlur1 and attach the copy to Monochrome1. You will notice a significant difference in rendering speed, even though both images are the same resolution.


Assigning a DOD

All images from disk will automatically get a DOD assigned to it equal to the resolution of the image. Here are five ways that you can alter the DOD:

  • The image is generated by Shake with a DOD. Nodes from the Image tab like RGrad, Text, QuickShape will automatically have a DOD assigned to them.
  • An image from disk is transformed or filtered. This image was read in and then scaled down and rotated with a Move2D. The DOD is automatically recalculated. Another example is if you blur an image, the DOD will expand accordingly.
  • A rendered .iff from Shake is embedded with a DOD. When Shake writes a .iff file, it will automatically save the DOD information. Only the .iff format supports this that we are aware of. In this example, we have read in the image that was written out from above.

  • The SetDOD node. This node, under the Transform tab, allows you to manually assign a DOD box to an image. Here, I want to limit my effects to the tower, so I attach a SetDOD node to it. This is a GREAT NODE. USE IT.



  • Combining an image with a second image with a DOD. When you combine two images, the DODs will combine as well to form a larger rectangle. If, however, you use a node like Inside or IMult, it will take the DOD of the second node. If I place the building image Inside of the QuickShape image from above, it inherits QuickShape1's DOD.



This technique of combining images is an excellent way to optimize green/bluescreen images that need garbage mattes, because it simultaneously removes the garbage areas and assigns an efficient DOD to the image. Here is an example tree:

SC_4_5_walk
QuickShape1
Primatte1
Inside1

By a good understanding of the role of the DOD, you can optimize the tree both before and after the node in question. The above tree example will not only optimize any nodes you attach to Inside1, but it also will only execute the Primatte and read in the part of the image that is inside of the DOD, cutting down on both processing and IO activity.

Keying, Color Correcting, and the BGColor

This section talks about the area outside of the DOD, which we term the Background Color, or BGColor for short.

The two main keyers in Shake, Keylight and Primatte, both recognize the background color, and have a toggle to either key it in or out. By default, the background area is left black in the alpha by the keyer. However, by toggling BGColor on, it will turn it completely white.

When color correcting the BGColor, Shake will process it very quickly, as it recognizes there is a pure correction applied to previously black pixels. If the color correction doesn't change black, like Gamma or Mult, it will be ignored. If it does affect the black areas, like Add or Compress, it will process these areas, but understand that they are still the results of a lookup process. Therefore, the DOD does not get reasserted to the resolution frame. This is the same process that is used when the Infinite Workspace kicks in. So, the result is, even though the pixels outside of the DOD are visibly no different from the pixels inside, the DOD remains in place.

 

There may be cases, however, where you do want to take advantage of the DOD for masking purposes. In this tree, we scale an image down, raise up the brightness with an Add command. This, however, turns the area outside of the image a medium grey. Since this area is recognized to be outside of the DOD, we can return it to black with the Color - SetBGColor node, which sets the color for the area outside of the DOD.

building
Move2D1
Add1
SetBGColor1

 

Masking using the Constraint Node

Another node to help limit a process is the Layer - Constraint node. You can place any two images in the Constraint node, and then mix the two according to a combination of modes. The modes are Area of Interest (AOI), tolerance, channel, or field. The one that interests us the AOI. Toggle it on, and then set the area box. Only the area inside of the box of the second image will be calculated.