Inspired 3D: Compositing Techniques and Methods — Part 1
The add function is useful for adding extra lighting effects to CG characters. Rendering a separate specular pass for a particular light provides an element that can be added into the original character. Because the alpha channels between the fully rendered character and the specular-only pass should match, the alpha can simply be replaced with the alpha from the original input image after the add function is performed. This is a powerful tool for adding detail elements and maintaining separate control of those elements within a comp script.


The opposite of an add function is a subtract function. This function takes each value from the A input side and subtracts the same channels information from the B-side. This function can create visually unusual results (see Figure 24), and I have rarely found a use for it in a production environment. Notice the areas in which the B image extends beyond the boundaries of the A image; the subtract function completely eliminates the values of the B-side (because the values outside of the cube are zero, and subtracting from them gets clamped to zero). It is also interesting to note that the brightest areas of the ball, where it was white, now become the darkest areas of the resulting image. If the A and B inputs are reversed and the beach ball becomes the A side with the cube becoming the B-side, the result is quite different (see Figure 25). The beach ball now forms the boundaries of the resulting image with a portion of the block appearing within it. If you thought the add function created unusual alpha channels, wait until you see what the subtract function does. Because the alpha values are subtracted, the resulting alpha is rarely useful for compositing the resulting image later in the comp script (see Figure 26). The confusing part is that the alpha channel resulting from a subtract operation does not match up with the color channels. In most compositing operations, the alpha channel mimics the outline of the color channels. Because the subtract function negates that correlation, utilizing an alpha channel resulting from the subtract function can be confusing.


Inside and Outside
The reverse of an inside function is an outside function. The outside function takes the inverse of the alpha channel from the B-side of the function to multiply with the A-side (see Figure 28). As with the inside function, the outside function does not use the color channels from the B input at all. Only the alpha channel from the B input is utilized. The outside function is also commonly shortened, and referred to simply as an out.
The inside function takes the input from the A side and places it inside of the B-sides alpha channel. The color channels from the B-side of the function are not used at all and have absolutely no effect on the resulting image (see Figure 27). Assuming that each shape has a solid alpha with the same shape as its color channels, the resulting image will have an alpha channel matching the resulting shape of the building blocks color channels. If the A input to the inside function has no alpha, the inside function will still produce the same results in the color channels but will have a blank alpha channel. This is because the actual operation is a multiplication of all the A-side channels by the B-side alpha. The inside function is often shortened and referred to as an in function.
![[Figure 26] Alpha channels from Figure 23 on the left and Figure 24 on the right.](http://www.awn.com/files/imagepicker/1/lighting08_26.jpg)























Post new comment