Wednesday, September 23, 2009

Texture Nodes

Here's a tutorial on texture nodes that I found scouring the web.

Introduction to Texture Nodes

Posted on 13. May, 2009 by Andrew Price in Tutorials

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

In this tutorial we will be creating a brick texture using nothing but procedural textures and Blender’s powerful new texture node system.

teary-nights

Let’s begin…

Start by adding a plane and rotating it to face the camera.

1-plane1

With the plane selected, add a new material and new texture. Those familar with blender will recognize that a new button labelled Nodes has been added. Click it. You will notice that doing so, disables the standard dropdown texture choices.

2-nodes-button

Now switch to the Node editor.

15-node-editor

Again, you will notice a new button has been added to the header, in the shape of a spotted square. Click it to switch to the Texturing Node system.

1-tex-button

By default you will see a checkboard and output nodes. Go ahead and delete the checkerboard node.

3-delete-checkboard

Creating the brick mask

Add a brick texture by hitting space then selecting, Add>Patterns>Bricks. Change the settings to the picture below and connect it to the Output node.

4-brick-settings

This basic brick texture will be used as the foundation to create our diffuse, bump, pattern and spec maps, so we want to make sure that if we change any of the settings, that all 4 textures update accordingly. So to do this, we need to create a group.

With only the Brick node selected hit Ctrl+G, and click Make Group. To make it easier to identify later, label it ‘Mask’:

5-mask

The new node system allows us to add multiple outputs to the same node screen for each texture map that we need. In this case we are creating 4, so with the Mask and the Output nodes selected, duplicate it three times and label the outputs: Diffuse, Pattern, Spec and Bump.

6-duplicated-nodes

That’s the basic brick mask set up. We will now move on to texturing each map accordingly.

Altering the Pattern Texture

Create two cloud inputs (Add>Textures>Clouds) and give them the following settings:

7-clouds

These cloud layers will be used to give the bricks a randomized texture pattern depending on the row and number of the brick. To do this, join each cloud layer to the brick inputs in the mask that is connected to the Pattern output:

8-clouds-connected

The Bias setting can be adjusted from -1.00 to 1.00. This determines how much of Brick 1 and Brick 2 to use. Setting it to 0.00 will use both Brick 1 and Brick 2 evenly, creating a nice random brick texture, which is ideal for what we want.

Altering the Specular Texture

Just like we did with our pattern texture, we are going to be adding a texture that will reflect the light off our bricks. So in this instance the Musgrave texture works best (Add>Texture>Musgrave). Give the Musgrave texture the following settings (making sure you change the colors as shown) then insert it into the Brick 1 slot. Now change the colour of Brick 2 to black:

9-spec

This will create a fine sandy texture that will reflect off the light.

Altering the Bump Map Texture

The bump is slightly different in that we aren’t altering brick slot 1 or 2, but instead converting the resulting texture to a normal map. To do this, add a Value to Normal node (Add>Convertor>Value to Normal) and place it in between the mask and the output as shown. Make sure that you change the connection on the output from Color to Normal.

10-bump

This will ensure our bricks have nice bevelled edges.

The node system is now complete!

11-full-nodes

Adding the Node System to the Texture Panel

If you switch to the texture panel in our material settings, you will notice that our texture now has a dropdown list next to it, listing each of our outputs. This allows us to bring the textures from node system into our standard texture panel and change the blending options.

To start with select Diffuse from the drop down list.

12-node-selector

Now swith to the Map To panel and make the following changes.

13-diffuse-multiply

Going back to our Texture Panel, add another texture slot and change the output to Spec:

14-spec-select1

Switch to the Map To panel and make the following changes:

14-spec-settings

Add another texture slot and select Bump for the output:

15-bump-select

Now make the following changes in the Map To panel:

15-bump-settings

Add a final texture slot and select Pattern as the output:

16-pattern-select

Switch to the Map To tab and make the following changes:

16-pattern-settings

That’s it! If you render now, you should get a result similar to this:

1-by-1

I used the default brick size for this tutorial which is quite large. If you want to decrease their size, this can easily be done by altering the size of the texture in the Map Input field.

17-map-input

For example, altering those numbers to 3.00 yields this result:

3-by-3

As you can see the texture node system is incredibly powerful. It can be used to quickly create texture combinations that previously would have required the use of an image editor. This opens the doors to faster workflows, more realistic textures and more artistic license.

download_blend

I hope you have enjoyed this tutorial! If you have any questions be sure to ask. I’d love to see your end result, so feel free to post it below!

No comments: