Blender 3D: Noob to Pro/Advanced Tutorials/Introduction to Cycles

From Wikibooks, open books for an open world
Jump to: navigation, search

Cycles is a renderer which first appeared in Blender 2.61. It offers more physically-accurate handling of lighting, based on a completely different handling of materials from the old Blender Internal renderer.

A Simple Cycles Example[edit]

Blender267CyclesMaterialContext.png

Start with a new Blender document. From the renderer menu Blender263RendererSelectionMenu.png at the top of the screen, select “Cycles Render”. Select the default cube. Go to the Material Context Blender255MaterialContextButton.png in the Properties Blender269PropertiesIcon.png Window, and you should see something like at right.

What happened to diffuse/specular shader settings, transparency, mirror, etc?

All that is gone. Instead, Cycles defines its materials in terms of something called a BSDF, or Bidirectional Scattering Distribution Function. When light hits the surface of an object, it can be reflected, absorbed or transmitted (through the material, giving rise to transparency or translucency), or more typically a combination of all three. Ignoring absorption (which means the light is lost anyway), the way the light is reflected can be represented mathematically as a BRDF, and the way it is transmitted as a BTDF; Cycles unifies the two into the general concept of a BSDF.

If you look in the window at right, you will see little in the way of actual material settings except for the choice of a “Diffuse Color” for the material, and above it a “Use Nodes” button. There is a little bit more in the “Settings” panel below (including what colour to use to show the object in the 3D viewport), but we will ignore that for now.

By default, the material is assigned a simple diffuse BSDF (non-shiny surface), and the only parameter exposed for you to play with is the diffuse colour. To get access to more, you will need to click the “Use Nodes” button. But don’t do that yet.

Instead, delete the default lamp. We are going to light our scene entirely with an emissive material. Why? Because, with Cycles, we can. In real life, we can usually see the sources of light in our scene, they are not invisible the way the Blender Internal renderer treats them.

Blender267CyclesMaterialDiffuseBSDF.png

Add a new UV sphere object, and position it above the cube. Go to the Materials Context, and assign it a new material. You should see a few more settings appear this time, as at right (if you see the “Use Nodes” button as before, then click it).

Blender267CyclesMaterialBSDFMenu.png

Go go the menu next to the label “Surface:”. Clicking on this will show you (in the left column) the list of available BSDFs:

Blender267CyclesMaterialEmissionBSDF.png

Select “Emission”. The “Surface” panel should now look like this:

Crude render with Blender Cycles

If you hit  F12  to render at this point, you will probably end up with something like this. This shows the emissive sphere shedding light on the diffuse cube, which shows Cycles in action, but is otherwise not very interesting. Also note the noise, particularly on the upper surface of the cube.

Let’s see if we can spice it up a bit.

Slightly better, but still crude, render with Blender Cycles

Add a plane below the cube, and scale it out a bit to look more like a floor. You can give it the same material as the cube. While we’re at it, go back to the glowing sphere and increase the Strength of the emission material to 10.

Now if you render, you should see something like this:

OK, so that’s slightly more interesting (if you look carefully, you can see the lower part of the cube pick up some light bouncing off the floor), but that noise is even more terrible than ever. Can we do something about that?

Yes we can.

Blender267CyclesRenderContextSamplingPanel.png

Go to the Render Context Blender255RenderContextButton.png in the Properties window. Look for the Sampling panel (this is specific to the Cycles renderer, you won’t have seen it while doing renders with Blender Internal). See the two numbers in the column headed “Samples:”, in particular the one labelled “Render:”. Change the number from the default 10 to 100.

Getting better, crude render with Blender Cycles

Now if you hit  F12 , you should see something like at right: the noise is noticeably less.

However: note the increase in render time. On my quad-core Core i7 machine, the previous image renderered in less than a second at 1500×2000 resolution, while this one took closer to 6 seconds—almost exactly a factor of 10.

You can crank up the number of render samples some more, and get an even better-quality result, but it will take even longer. This is the tradeoff with all high-quality renderers, not just Blender Cycles: you can get better results, but at the price of longer render times.

Real-Time Rendering Previews[edit]

Blender267ViewportShadingCycles.png

Cycles has another little trick up its sleeve. In the 3D view Blender2693DViewIcon.png window, look for the shading menu, where you can choose solid/wireframe/textured etc previews.

Notice anything different? With Cycles enabled, there are extra “Material” and “Rendered” items in this menu. Try selecting “Rendered”, and suddenly you will be seeing a full Cycles render happening in the 3D view! Try rotating the view, zooming and out etc, and watch the render being redone every time: initially it starts out very blocky and noisy, then gradually refines itself if you don’t touch anything.

Remember the two render samples values we encountered above? Now you know what the lower “Preview” one is for: it controls the quality of rendering done in preview mode. You can also set this value to 0, which means “infinite”: rendering becomes a never-ending process, where the quality of the image gets better and better, the longer you leave it. Of course, you can interrupt it at any time, just by doing something to the view.

Of course, all the usual object/edit-mode functions etc remain available, but they’re a bit hard to use, because there is no selection feedback in this view.

Nodes? What Nodes?[edit]

This example has been a very simplistic use of Cycles materials. Much more sophisticated uses are possible, by combining various BSDFs and putting them through all kinds of processing. But that requires delving into the Node Editor.

See Also[edit]