From BlenderWiki

< Doc:Tutorials | Materials | Nodes
Revision as of 20:53, 1 March 2009 by Mindrones (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search

[edit] Reference

For reference on the different node types, see this article's separate reference page.

[edit] Node-Based Materials Tutorial

NOTE
This tutorial is under construction. For a more usable (if still under construction) source of information on nodes, see this article's separate reference page.


[edit] Introduction

A popular feature request has been added: node-based material shaders. The basic design is a flowchart of different "nodes," each of which modifies a color, a direction vector, or a single value (such as alpha).

What does this mean in practice? It means that instead of building one material per object, you can build as many as you want and blend them together in the Node Editor. If you desire, you can even build entire materials purely inside the node editor, using the Blender's materials panels to provide shading values only.

Nodes are an entirely different way of visualizing materials. They are in essence, graphical programmable shaders, which can make them confusing to use. For many people it may be easier to learn by doing, which is why the first part of this documentation is a tutorial.

NOTE
If Blender lags in this tutorial, try turning "International Fonts" on in the user preferences. Some ATI cards cannot render blender's normal fonts without severely lagging.


[edit] Building Your First Node Shader

[edit] Part I: Setup

Start up Blender. Make sure your starting with the default single-cube scene. Download the files in the Downloads section.

Image:Tutorials-NT-defaultview.png

Rotate the view with the middle mouse button like in the below image, and scale the cube along the Z-axis untill it is fairly flat (you can also go into editmode and delete the top vertices of the cube if you wish).

Image:Tutorials-NT-sizecube.png

Change the 3D View area into a Node Editor by using the left-most popup button on the 3D View header. Select "Node Editor" from the list.

Image:Tutorial-NT-viewchanger.png Image:Tutorials-NT-viewmenu.png

Your first view of the Node Editor will be of an empty gray screen, as shown below.

Image:Tutorials-NT-nodeview.png

Goto the material buttons in the buttons window, then press "Use Nodes" either inside the Node Editor itself, or in the material buttons. When the material that was active disappears, make sure to either reload it or press the "Add New" button.

You will now see a view like this:

Image:Tutorials-NT-view2.png

There are two "nodes" inside the editor now, a Material node and a Output node. The Material node is connected to the Output node by a connection between the Material node's output color socket and the Output node's input color socket (both of which are yellow to denote that they work with color values).

You can move a node around by clicking in its "titlebar" at the top. The various buttons on the titlebar will collapse the node in different ways. The triangle will completely collapse it, leaving only the input/output points showing; the "+" will hide any unused input/output points, the one next to the "+" will hide any buttons showing, and the circle next to that will hide any preview window within the node.

Node sockets (those circles on the node's sides) can be a color (yellow), a vector (blue), or a single value (grey) such as alpha. A node's input sockets are on the left side of the node, while the output sockets are on the right. Therefore the Material node can be connected to another node to receive the specular and diffuse colors, a normal vector (not visible is this view) and a reflection value. The Material node will output a single color, an alpha value plus a normal vector.

Disable the specularity of the Material node by clicking the "Spec" pushbutton below it. Go back to the material buttons and change the material's diffuse color to a greenish hue (you can also click the rectangle next to the Color input node on the material node itself) as shown below.

Image:Tutorials-NT-leafcolorview.png

As a sidenote, whenever you click on a material node, you will be able to edit its associated material in the material buttons.

Download the image file Hojo.tga attached to this tutorial. Now go to the material buttons, and add an image texture. Load the image into the texture. Press Use Alpha, then go back to the material buttons and slide the Alpha slider all the way to zero. Go and set the texture mapping mode to "Alpha."

[edit] Final Notes

[edit] Links

[edit] Downloads

Tutorials-NT-Leaf.png

Tutorials-NT-LeafBump.png

[edit] Credits

This article was written by Joseph Eagar.

Credits go to Halley for vocabulary fixes and making the main diagram in the reference section make sense, and to ZanQdo whose .blend the main tutorial is based on.

What .blend file? Where is it? Are you still updating this tutorial?