Z通道合成节点

../../../_images/compositing_node-types_CompositorNodeZcombine.png

Z通道合成节点。

Z通道合成节点基于图像的Z通道信息将两个图像进行合并。通过检测发现哪个图像在上面,将其Z通道值进行覆盖叠加到另一幅图像的Z通道上。

输入

图像

背景图像。

Z通道

背景图像的Z深度通道。

图像

前景图像。

Z通道

前景图像的Z深度通道。

属性

使用 Alpha

“选定”图像像素的alpha通道被执行操作。如果像素的部分或整体是透明的,Z通道合成的结果也会呈现局部透明的效果;在这种情况下,背景图像将穿透前景(“选定”)图像像素显示出来。

Z通道抗锯齿

应用 抗锯齿 高对比度图像产生人为的锐利图像边界或范围。

输出

图像

如果两个Z深度通道是相同的,使用前景图像的Z深度通道值。关于如何决定两个Z深度通道被取舍和使用的详细信息,参见 Z缓冲

Z通道

Z通道合成节点允许多个同类节点相连接。

范例

../../../_images/compositing_types_color_z-combine_example-1.png

选取临近像素。

In the example above, the render output from two scenes are mixed using the Z Combine node, one from a sphere of size 1.3, and the other a cube of size 1.0. The sphere and square are located at the same place. The cube is tipped forward, so the corner in the center is closer to the camera than the sphere surface; so Z Combine chooses to use the cube’s pixels. But the sphere is slightly larger (a size of 1.3 versus 1.0), so it does not fit totally inside the cube. At some point, as the cube’s sides recede back away from the camera, the sphere’s sides are closer. When this happens, Z Combine uses the sphere’s pixels to form the resulting picture.

此节点可用一张背景遮罩图像合并一张前景图像中。华特迪士尼最早开发了多层遮罩技术,将三张或四张局部遮罩绘制在玻璃片上,放置在左侧和右侧并在Z景深位置保持距离;小型摄影机移动到右侧拍摄出小鹿斑比穿过森林的影像。

Note

合理输入值

Z Input Sockets do not accept fixed values; they must get a vector set (see Map Value node). Image Input Sockets will not accept a color since they do not have UV coordinates.

../../../_images/compositing_types_color_z-combine_example-2.png

混合并匹配图像。

Z通道合成也可以用做两张图像的融合,使用如图场景中球体和立方体的Z值信息连接到Z通道合成节点的“Z插口“上,将另一张图像作为背景图像连接到Z通道合成节点的“Image“插口,两者融合输出产生了如图片上右侧所展示的合成结果(立方体可见,球体不可见)。

../../../_images/compositing_types_color_z-combine_example-3.png

Z通道合并的执行。

这个节点装配由静态图像混合而成的渲染场景。在场景侧视图中,橙色立方体距离摄影机10个单位的距离,蓝色球体和3D游标分别为20个单位距离及15个单位距离。图像的景深值为15,融合在立方体和球体之间。图像合成的结果是在绿色静态背景上只显示立方体。

Note

隐身人特效

如果前景图像的Alpha值高于背景图像值,则与稍微放大的背景混合在 Z 合成中,透明区域的轮廓将扭曲背景,使其看起来像通过一个不可见的但菲涅尔-镜头对象观察的结果。