Book Image

Blender Cycles: Materials and Textures Cookbook, Third Edition

By : Enrico Valenza
Book Image

Blender Cycles: Materials and Textures Cookbook, Third Edition

By: Enrico Valenza

Overview of this book

Table of Contents (17 chapters)
Blender Cycles: Materials and Textures Cookbook Third Edition
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Introduction


Cycles' materials work in a totally different way than in Blender Internal.

In Blender Internal, you can build a material by choosing a diffuse and a specular shader from the Material window, by setting several surface options, and then by assigning textures (both procedurals and image maps as well) in the provided slots. All of these steps make one complete material. After this, it's possible to combine two or more of these materials by a network of nodes, thereby obtaining a lot more flexibility in a shader's creation. However, the single materials themselves are the same as those set through the Material window—shaders made for a scan-line-rendering engine—and their result is just an approximation of the simulated absorption-reflection behavior of light on a surface.

In Cycles, the approach is quite different. All the names of the closures describing surface properties have a Bidirectional Scattering Distribution Function (BSDF), which is a general mathematical function that describes the way in which light is scattered by a surface in the real world. It's also the formula that path tracers such as Cycles use to calculate the rendering of an object in a virtual environment. Basically, light rays are shot from the camera. They bounce on the objects in the scene and keep on bouncing until they reach a light source or an empty background (which, in Cycles, can emit light as well). For this reason, a pure path tracer such as Cycles can render in reasonable times an object set in an open environment. The rendering times increase a lot for closed spaces, for example, furniture set inside a room, because light rays can bounce on the floor, the ceiling, and the walls many times before reaching one or more light sources.

In short, the main difference between the two rendering engines is due to the fact that, while in Blender Internal, the materials use all the traditional shader tricks of a scan-line rendering engine such as the simulated specular component, the Cycles rendering engine is a path tracer that tries to mimic the real behavior of a surface as closely as possible as if the surface were real. This is the reason we don't have an arbitrary Specular factor simulating the reflection point of light on the surface in Cycles, but instead have a glossy shader that actually mirrors the light source and the surroundings to be mixed with other components in different ratios. Thus the glossy shader behaves in a more realistic way.

Just for explanatory purposes, in this book, I will refer to the more or less blurred point of light created by the reflection of the light source on a mirroring glossy surface as specularity.

Be aware that the rendering speed in Cycles depends on the device you use to render your scenes—CPU or GPU. This means that basically, you can decide to use the power of the CPU (default option) or the power of the graphic card processor, the GPU.

To set the GPU for the rendering, perform the following steps:

  1. Call the Blender User Preferences panel (Ctrl + Alt + U) and go to the System tab, the last tab to the right of the panel.

  2. Under the Compute Device tab to the bottom-left corner of the panel, select the option to be used for computation. To make this permanent, click on the Save User Settings button or press Ctrl + U. Now close the Blender User Preferences panel.

  3. In the Properties panel to the right of the screen, go to the Render window and, under the Render tab, it's now possible to configure the GPU of the graphics card instead of the default CPU (this is possible only if your graphic card supports CUDA, that is, for NVIDIA graphic cards. OpenCL, which is intended to support rendering on AMD/ATI graphics cards, is still in a very incomplete and experimental stage, and therefore, not very usable yet).

A GPU-based rendering has the advantage of literally increasing the Cycles' rendering speed several times, albeit with the disadvantage of a small memory limit, so it's not always possible to render big complex scenes made up of a lot of geometry. In such cases, it's better to use the CPU instead.

There are other ways to reduce the rendering times and also to reduce or avoid the noise and the fireflies (white dots) produced in several cases by the glossy, transparent, and light-emitting materials. All of this doesn't strictly belong to shaders or materials. By the way, you can find more information related to these topics at the following addresses:

Information on Cycles Render Engine can be found at http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles.

More information on Reducing Noise is available on the Cycles wiki page, at http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Reducing_Noise.

A list of supported graphic cards for Cycles can be found at https://developer.nvidia.com/cuda-gpus.