From BlenderWiki

Jump to: navigation, search

The Compositor Editing Mode of the node editor is a major part of the render pipeline, meant to work with Render Layers The compositor can be used for countless visual effects, most of which can be grouped into group nodes and for later reuse (through library appending or linking).

[edit] Compositor Editing Mode

Click this button to access the Compositor

The Node Compositor is accessed by clicking the picture-box button in the Node Editor header. Press the Use Nodes button to enable it. Add nodes with SHIFT-A, just like for shader nodes.

After pressing Use Nodes, a special image in the UV editor (called "Compositor") will be created. This image will be used to preview any node you connect to a Viewer node.

Note
In the Compositor, all nodes socket types (value, vector, RGBA) are treated as images as opposed to node shaders, where they are single values. For this reason, yellow sockets will be referred to as image sockets rather then color sockets, grey sockets will be referred to as value images, and blue sockets will be referred to as vector images.


[edit] Inputs

[edit] Render Result

Menu: Shift AInputs → Render Layer

The Render Layer node outputs all render passess enabled for a selected render layer. At the moment this is limited to image, alpha, Z (depth), and speed.


[edit] Image

Menu: Shift AInputs → Image

[edit] Description

The image node outputs any image loaded in the UV image editor. Besides outputting the actual image, this node can also output alpha and depth values (if the image has them). Animated images or avi files are also supported.

[edit] Options

To enable animated image sequences, press the little film strip button. To enable AVI animations, press the film strip button that appears after you pressed the first one.

The "Frs" number button is the number of frames in the sequence to play. The "SFra" number button sets the start frame of the animation. The "First" number button sets the first number in the animated sequence name. For example, if your images were called "1xxx" you'd put 1, etc.


[edit] Texture

The Texture node makes 3D textures available to the Compositor. Note that you cannot edit the textures themselves in the node window. To use this node, create and edit the texture in the normal texture buttons, then select the texture from the menu button on the node.

You can input an offset and a scale for the texture. Texture nodes can output a straight black-and-white value image (don't mistake this for alpha) and an image.


[edit] Value

The Value node has no inputs; it just outputs the value currently entered in the numbutton displayed in its controls selection.


[edit] RGB

The RGB node has no inputs; it just outputs the color currently selected in its controls section.


[edit] Time

The time node generates a value (from 0 to 1; the Map Value node can be used to map the output to a more appropriate value) that changes according to the curve drawn. The Start and End numbuttons specify the range of time the values should be outputted along.



[edit] Outputs

[edit] Composite

The Composite node is where the actual output from the compositor is connected to the renderer. Connecting a node to the Composite node will output the result of that node's full tree to the Renderer; leaving this node unconnected will result in a blank image. You can connect three channels: the actual RGBA image, the alpha image, and the Z (depth) image.


[edit] Viewer

Very similar to the Composite node but the output of the currently selected Viewer node is available in the UV/Image Editor. Useful to preview or troubleshoot an effects chain.



[edit] SplitViewer

Like the normal Viewer node except there are now two image inputs. The slider selects the position of a hard split between the images along the X or Y axis dependeng on which button is pressed.



[edit] FileOutput

Connecting a node to the FileOutput node will output the result of that node's full tree to the specified file; leaving this node unconnected will result in a blank image. The options are the same as their counterparts in Scene->Output.




[edit] Color Ops

[edit] RGB Curves

The RGB Curves node maps an input image's intensity, red, green, and blue components to a curve. The four channels are accessed via the C, R, G and B buttons at the top of the node. Add points to the curve by clicking on it.

Note that dragging a point across another will switch the order of the two points (e.g. if point A is dragged acros point B, then point B will become point A and point A will become point B).


[edit] Mix

The Mix node is used to mix two images or colors together. It takes two images (obviously) and a factor value as inputs. The second image is mixed with the first, according to the value of the factor socket. You can connect value images to the factor socket to provide masks.

The popup menu button lets you choose between Mix, Add, Subtract, Multiply, Screen, Overlay, Divide, Difference, Darken, and Lighten color mixing methods. You can either connect a node to the factor input socket, or you can manually specify a factor, but you cannot do both.

Note
This node only uses the alpha values from the first input image as output and it doesn't take the alpha values from the second image into account.


[edit] Hue/Saturation

The Hue/Saturation adjusts an image's tint and color saturation. Besides taking an image as an input, Hue/Saturation can also take a value image to control how much the input image is changed by the hue/saturation sliders.


[edit] Alpha Over

In the Compositor, all images automatically keep their alphas, even though in many nodes you can connect an alpha value image to override this. The Alpha Over node takes advantage of this to overlay one image (connected to the bottom socket) over another (connected to the top image socket). As with Mix and Hue/Saturation, a value socket can be connected to Factor to control how transparently the first image is overlayed the second. The ConvertPre button is used to convert the premultiplied alpha of the first image to the background of the second, eliminating the ugly outlines you get otherwise.


[edit] Z (Depth) Combine

The Z Combine node takes two color and two value images as input. It overlays the bottom color image over the top, using the provided Z values to detect which parts of the objects inside the foreground image is in front or behind the background image. Obviously, for best results both images must have the same camera settings, and having the same viewpoint helps too.


[edit] Vector Ops

[edit] Normal

The Normal node generates a normal vector and a dot product. Dragging the sphere will set the direction of the normal.


[edit] Vector Curves

The Vector Curves node maps an input vector image's x, y, and z components to a diagonal curve. The three channels are accessed via the X, Y, and Z buttons at the top of the node. Add points to the curve by clicking on it.

Note that dragging a point across another will switch the order of the two points (e.g. if point A is dragged acros point B, then point B will become point A and point A will become point B).



[edit] Map Value

Map Value node is used to scale, offset and clamp values. Offs will add a number to the value, size will scale (multiply) the value by a number, and by pressing min/max you can set the minimum and maximum numbers to clamp the value too.

This is particulary useful in achieving a depth-of-field effect, where you can use the Map Value node to map a Z value (which can be 20 or 30 or even 500 depending on the scene) to to range between 0-1, suitable for connecting to a Blur node.


[edit] Filters

[edit] Filter

The Filter node implements various common image enhancement filters. The supported filters are Soften, Sharpen, Laplace, Sobel, Prewitt, Kirsch and Shadow. The Soften filter slightly blurs the image, Laplace, Sobel, Prewitt and Kirsch all perform edge-detection (in slightly different ways), while the Shadow filter performs a relief emboss/bumpmap effect.

The Filter node has seven modes, shown here.


[edit] Blur

The Blur node blurs an image, using one of seven blur modes (set using the upper-left popup button), and a radius defined by the X and Y number buttons. By default these are set to zero, so to enable the node you must set one or both to a value greater then 0. You can optionally connect a value image to the Size input node, to control the blur radius with a mask. The values must be mapped between 0-1 for best effect, as they will be multiplied with the X and Y number button values.

The Bokeh button (only visible as Bok or Bo on some screen setups) will force the blur node to use a circular blur filter. This gives higher quality results, but is slower then using a normal filter. The Gam button (for "gamma") makes the Blur node gamma-correct the image before blurring it.

The Blur node supports seven blur modes, as shown here


[edit] Vector (Motion) Blur

Menu: Shift AFilters → Vector Blur

[edit] Description

Motion blur is the effect of objects moving so fast they blur. Because CG animations work by rendering individual frames at (usually) a rate of about 30 frames per second, they don't naturally produce motion blur.

In Blender, there are two ways to produce motion blur. The first method (which produces the most correct results) works by rendering a single frame up to 16 times with slight time offsets, then accumlating these images together. The second (and much faster) method is the Compositor node Vector Blur.

To use, connect the appropriate passes from a Render Result node.

Note
Make sure to enable the Speed (called Vec) pass in the Render Layers panel for the render layer you wish to perform motion blur on.

[edit] Options

Because of the way vector blur works, it can produce streaks, lines and other artifacts. These mostly come from pixels moving too fast; to combat these problems, the filter has minimum and maximum speed settings, which can be used to limit which pixels get blurred (e.g. if a pixel is moving really, really fast but you have maximum speed set to a moderate amount, it won't get blurred).


[edit] Example

Blender supports two methods of motion blur, shown here.

The two modes of motion blur are shown to the right; note how vector blur makes more "blocky" blurs, while normal motion blur is more smooth.

[edit] Hints

You can make vector blur results a little smoother by passing the Speed pass through a blur node (but note that this can make strange results, so it's only really appropriate for still images with lots of motion blur).


[edit] Technical Details

Vector Blur works by keeping track of the directions the pixels in an animation are moving, then using that information to produce a blur effect. It produces a fairly good effect, though it does suffer from a few limitations. The filter won't work on transparent objects or shadows, and large faces partly off-camera can cause strange results.

[edit] Converters

[edit] ColorRamp

The ColorRamp Node is used for mapping values to colors with the use of a gradient. It works exactly the same way as texture colorbands, taking a value (typically from a texture) and outputting a color value and an alpha value.

To add colors, hold Ctrl down and click inside the gradient. Edit colors by clicking on the empty rectangle, which pops up a color-editing dialog. Drag the gray slider to edit alpha values. Note that you can use textures for masks (or to simulate the old "Emit" functionality) by connecting the alpha output to the factor input of an RGB mixer (see below).


[edit] RGB to BW


[edit] Seperate RGBA

The Seperate RGBA node separates an image into red, green, blue and alpha channels.


[edit] Seperate HSVA

The Seperate HSVA node separates an image into hue, saturation, value and alpha channels.


[edit] Set Alpha


[edit] Translate

The translate node translates (moves) an images by the specified amounts in the X and Y directions.

[edit] Matte Nodes

[edit] Chroma Key Node

The Chroma Key node works by determining the distance in color space between two colors, or the difference between two colors. One color is the key and the other color is being check against the key to determine if it should be transparent or not.

Chroma Key matting does not rely on a certain background color, but can have less than optimal results if there is a significant amount of background color in the foreground object.

[edit] Inputs

There are two inputs to this node. The first is an input image that is to be keyed. The second input is a key color. The key color may be selected by using the eyedropper tool in the color select window.

[edit] Outputs

The outputs of the node are the image with the new alpha channel and a matte that represents the alpha channel.

[edit] Color Space

  • (Green / Blue)

This button group selects which color space the difference algorithm works in. Different color spaces work better for different backgrounds.

[edit] Cb Slope / Cb Pos / Cr Slope / Cr Pos Sliders

You can adjust the tolerance of each axis individually so that you can more red variance or blue variance in what you would allow to be transparent. I find that about .15 (or 15%) is plenty of variance if the background is evenly lit. We will cover what to do if it is not evenly lit (such as our spaceship footage in a moment).

[edit] Falloff

You can adjust the amount of transparency that a pixel has by the distance that it is from the actual key location. So that pixels that are closer to the key are more transparent that ones that are further away. This is called falloff. If you want pixels that are far away to be considered very transparent, then use a high falloff value.

[edit] Alpha Threshold

The alpha threshold determines how transparent a pixel should be once it is determ