Thursday, December 8, 2011

Cycles Nodes Microtutorial

Recently, I opened an older Blender file I had used to do some test renders in Cycles, and I noticed that some of the materials were broken. At first I thought that the new Cycles had changed so much that the older setup was no longer compatible. Then, I realized that the reason for the broken nodes was that I had not connected some of the node inputs into outputs of the same color. Cycles was fine, after all, and all that was needed was that I connect same color with same color. So this is the tutorial.
Very basic: for Cycles nodes (and for any node, in general) connect same color to same color. That's it.

There are a few colors, and this is what they mean:
Yellow: an RGB value.
Grey: a Greyscale value.
Green: a Shader (which is the same to say as Cycles material)
Blue: a Vector. A vector is a hard concept to explain. It has to do with the projection mode of the material on the model polygons, and the scaling and manipulation of the texture in its own local space. In essence, a vector is a way to describe a dimension. In Cycles, it is mainly, but not only, used to define the texture space (generated vs. UV).

I just Control-A added some nodes, doesn't much matter which. Notice that they all have different colors for the input
and output. It is essential to notice those colors, and connect things in the right order.

I connect the nodes. The final material is a Mix Shader with a B&W displacement from mixing a texture plus a color. The texture will be used in a Generated vector way, and scaled 5 times up (which make sit 5 times smaller—really). The Diffuse and Glossy shaders used in the Mix Shader don't specify a Vector, which in Cycles is UV by default.
So, to sum it up, connect same colors with same colors!

PS: here are two screenshots of a scenario where the material gets broken. Before and after. All I did was connect same color to same color. I think it worked.

Disconnected

Connected by following the rule

5 comments:

  1. What is your solution for this excellent shader of grapes in newest version of Cycles.

    http://blenderartists.org/forum/showthread.php?216113-Brecht-s-easter-egg-surprise-Modernizing-shading-and-rendering&p=1861856&viewfull=1#post1861856

    ReplyDelete
  2. I'm going to post two more screenshots on the original post so you see a before and an after. Let me know if that fixes it.

    ReplyDelete
  3. Great! This is it. Works perfect! Very useful tips. Thanks Andreu:-)

    ReplyDelete
  4. your simple advice (connecting node connectors of the same colour) saved me hours trying to get a working BSDF image texture to work as displacement(bump map)
    thank you thank you!

    ReplyDelete