From BlenderWiki

< Doc:Reference | Windows | Nodes
Revision as of 17:44, 19 February 2009 by Mindrones (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Blender's node Shader Editor is a powerful tool meant to manipulate and combine Blender materials. It can also be used to a certain extent to create material-independant shader networks, but its usefulness for that purpose is limited.

[edit] Material Editing Mode

The Shader Editor mode is accessed by clicking the sphere button in the Node Editor header. Press "Use Nodes" to enabled shader nodes for a given object.

Note
Keep in mind that unlike Compositor nodes, material nodes do not send images over the wires. In the Compositor, an alpha socket will literally contain a grayscale image, while in Material Editing Mode, an alpha socket will contain only a single value. Another difference is that a material node network is executed many times for each object, while a Compositor network is only executed once.


[edit] Inputs

[edit] 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.

Note
The normal input socket does not in any way blend the source normal with the underlying geometry.


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.


[edit] 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.


[edit] 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.


[edit] Outputs

[edit] Output Node

The Output node is used to output to the renderer. The first Output node you add shows a preview of the final render output after all nodes are processed. This Node is indicated with a red sphere in its title bar.

Other Output nodes can be added and used for previewing different parts of the node process.

This node takes two inputs, color and alpha.


[edit] Color

[edit] 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, Lighten, Dodge, Burn, Color, Value, Saturation, and Hue 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.


[edit] RGB Curves Node

The RGB Curves node maps an input colors'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
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] Normal

[edit] Normal Node

The Normal node generates a normal based on the direction of the sphere inside the window, which can be dragged with the mouse to point in different direction. It can also output the dot product between the normal and an input vector, which can be used to produce a shading effect.

Basic diffuse lambert shading works by finding the dot product between an object's normal (e.g. from the Geometry node) and a directional lamp normal (e.g. from this node). This dot product will be the shading in grayscale, and can be mapped to other nodes to produce a color. In this case the normal node effectively acts as a very simple lamp.


[edit] 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.


[edit] Vector Curves Node

The Vector Curves node maps an input vector'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
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] Converters

[edit] 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).


[edit] RGB to BW Node

The RGB to BW node converts an input RGB color to an output grayscale value.