Tutorials/Nodes Tutorial Ref
Wikipedia,自由的百科全书
Contents
|
Introduction 简介
原文链接:[1]
This page is used for reference on material and compositing nodes.
本文是基于节点的材质与视频合成的参考指南。
Loading the Node Editor 加载节点编辑器
Make sure you have a free area window in Blender to use. The Node Editor can be found in the areatype menu, as shown below:
用菜单栏最左边的按钮可以切换到节点编辑器(Node Editor)。节点多的时候比较占屏幕,所以你最好腾出一块较大的窗口。
To use nodes, you must press "Use Nodes" in the header of the Node Editor window. In the case of material nodes you must press either this button or its equavalent in the material buttons for every object you use material nodes with.
要使用节点,必须激活节点编辑器菜单栏上的“Use Nodes”按钮,或者激活材质面板的“Node”。
The Node Editor Window 节点编辑器窗口
Node 节点
The Node Editor window is used to either edit an object's material nodes, or to edit the scene's compositor node tree. You can switch between the two modes by clicking either the left (material) or right (compositor) buttons on the header.
节点编辑器窗口有两个用途:
1、用于编辑基于节点的材质(即节点材质) 2、用于编辑基于节点的视频合成
The following image illustrates what a node is:
节点长什么样?看下图,里面有三个节点:
- The node's titlebar. This contains the node's name, along with several different collapse buttons.节点的标题栏,它包含节点的名字,以及几个功能类似的收缩按钮。
- The left side of a node has input sockets. Blue sockets accept vectors, yellow sockets accept colors, and grey sockets accept single values.左边是节点的输入接口(input sockets)。蓝色接口用于接收向量(vectors),黄色接口用于接收颜色(colors),灰色接口用于接收单值(single values,比如透明度)
- The right side of a node has output points. Blue points produce vectors, yellow points produce colors, and grey points produce single values (like alpha).右边是输出接口,蓝色点输出向量,黄色点输出颜色,灰色点输出单值,比如Alpha透明度。
- The arrow on the left completely collapses or "shades" the node. Click the smaller node again to see its contents.标题栏里面点三角形用于收缩(或者说隐藏)节点,收缩之后,再点击一次三角形,节点会重新展开。
- The plus-sign button on the right side of the titlebar hides unused input/output sockets. Click again to see all sockets, connected or not.加号按钮的功能,类似上面提到的三角形,只不过,这个按钮只是隐藏接口。
- The double-line button in the middle right hides or shows all of the interface controls, simplifying the node's appearance. Click again to see the controls.双线按钮也是用于收缩节点,它只收缩参数调整部分。
- The sphere button on the far right of the titlebar hides or shows the preview image.球型按钮用于隐藏图片部分。
- A curved line shows a connection from an output socket to an input socket. The socket types must match. Connections associated with the active node are highlighted for better visibility.曲线代表接口与接口之间的关系,颜色不一样的接口不能相连。
To connect an input point to an output point, simply drag from one socket to the other. Attempting to connect sockets of different types (e.g., different colors) will result in a converter node being added automatically to change the output point type to the input point type. You can also make many connections feeding from the same output socket, but only one connection can enter an input socket.
要连接一个输出接口和一个输入接口,直接拖动接口,拉出线,拖到另一个接口就行了。如果你尝试连接不同类型的接口,那么Blender会尝试在两个接口之间添加一个中转节点。
输出接口可以拉出很多条数据线,而输入接口只能输入一条数据线。
Navigation in the Node Editor 节点编辑器基本操作
Navigation in the Node Editor window is the same as in all other Blender windows. Middle mouse button hold (emulated with ALT-left hold) pans the space, while also holding CTRL will zoom in/out (note you have to stop panning to do this).
跟Blender其它类型窗口的操作一样,鼠标中键拖动(或者alt+左键拖动),可以平移视图,滚轮则是放大缩小。
Adding a Node 添加一个节点
To add a node, simply press SHIFT-A in the node editor and select a node from the list.
要添加一个节点,很容易,按 SHIFT + A ,出来一个菜单,里面有各式各样的节点,任你挑选。(前提是,当前材质是节点材质,如果不知道如何激活节点材质,看这里http://wiki.blendercn.org/index.php/Tutorials/Nodes_Tutorial)
Node Editor Reference 节点编辑器参考(正文开始)
Material Editing Mode 材质模式下的节点
This section will cover each node type in detail. Pay attention especially to the texture and geometric nodes, as they aren't exactly obvious to everyone (well, at least the author struggled with them).
Material Node 材质节点
The Material node is used to add a material to the node program. As of Jan 19, materials can be anything from pure shading to fully layered with textures.
Materials can output color (which includes shading and any textures assigned to it), alpha, and the final normal calculated from any textures it has.
Materials can also take inputs color inputs for diffuse color and specularity color, a value for reflectivity, and a normal for inputting normals from textures.
The Diff button will turn on/off Diffuse Color. The Spec button will turn on/off Specularity calculation, and the Neg button inverts the material input normal (which, of course, is a combination of the 3D normal given to it by the 3D object plus the normal input point).
You can browse materials via the purple popup menu.
Output Node 输出节点
The Output node is used to output to the renderer. Only one Output node not will do this, but other nodes of this type can be used for previewing different parts of the node program.
This node takes two inputs, color and alpha.
Geometry Node 多边形节点
The geometry node is used to specify points in space. This node is used mainly for texture mapping; like normal texture layers, you can choose between a 3D object's local space and global space, original (pre-deformed) mesh coordinates, UV texture coordinates, object normals, and camera view vector.
Texture Node 贴图节点
The Texture node is used to load textures into the node program. 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.
To map the texture to a specific geometric space, you need to connect the input blue vector point to a geometry node (see above).
Texture nodes can output a straight black-and-white value (don't mistake this for alpha), a color, and a normal.
ColorRamp Node 渐变颜色节点
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).
RGB Mixer Node 红绿蓝 混合 节点
The RGB Mixer node is used to mix two colors together. It takes two colors (obviously) and a factor value as inputs (you can connect an alpha to the factor point to provide masks from things like textures).
The popup menu button lets you choose between Mix, Add, Subtract, Multiply, Screen, 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.
Mapping Node 映射节点
The Mapping Node is used to transform vectors (such as output from a geometry node). You can translate, scale and rotate the vectors; in addition you can bound the vector values between minimum and maximum values (via the Min and Max buttons, although at some zoom levels the Max button will only display Ma).
It takes one vector as an input, and one vector as an output.
Compositor Editing Mode 视频合成模式下的节点
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. |
Inputs 输入类
Render Result 渲染结果
The Render Result node outputs all render passess enabled for a selected render layer. At the moment this is limited to image, alpha, Z (depth), and speed.
Image 图像
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).
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.
Outputs 输出类
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.
Viewer 视图
As stated previously, connecting any node to a Viewer node will output that node's result to the special UV editor image "Compositor." You can have only one Viewer node; adding more than one can have strange results.
Color Ops 色彩处理类
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).
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.
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.
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.
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.
Color Ops
Normal
The Normal node generates a normal vector and a dot product. Dragging the sphere will set the direction of the normal.
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).
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.
Filters
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.
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.
Vector (Motion) Blur
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.
Vector Blur essentially works by keeping track of the which directions the pixels in an animation is 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.
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).
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. |
Converters
ColorRamp
RGB to BW
Seperate RGBA
The Seperate RGBA node separates an image into red, green, blue and alpha channels.
Seperate HSVA
The Seperate HSVA node separates an image into hue, saturation, value and alpha channels.
Set Alpha
Translate
The translate node translates (moves) an images by the specified amounts in the X and Y directions.
Generators
Value
The Value node has no inputs; it just outputs the value currently entered in the numbutton displayed in its controls selection.
RGB
The RGB node has no inputs; it just outputs the color currently selected in its controls section.
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.






































