Book Image

Blender Cycles: Lighting and Rendering Cookbook - Second Edition

Book Image

Blender Cycles: Lighting and Rendering Cookbook - Second Edition

Overview of this book

Blender provides a broad spectrum of modeling, texturing, lighting, animation and video post-processing functionality in one package. It provides cross-platform interoperability, extensibility and a tightly integrated workflow. Blender is one of the most popular Open Source 3D graphics applications in the world. Modern GPUs (Graphics Processing Unit) have some limitations for rendering complex scenes. This is mainly because of limited memory, and interactivity issues when the same graphics card is also used for displaying and rendering frames. This is where Cycles rendering engine comes into play. Cycles is bundled as an add-on with Blender. Some of the features of Cycles is its quality, speed and having integrated industry standard libraries. This book will show you how to carry out your first steps in Cycles - a brand new rendering engine for Blender. In a gradual and logical way, you will learn how to create complex shaders and lighting setups to face any kind of situation that you may find in Computer Graphics. This book provides information on how to setup your first application in Cycles. You will start by adding lights, materials, and textures to your scene. When it's time for the final render, you will see how to setup Cycles in the best way. You will learn about a wide variety of materials, lighting, techniques, tips, and tricks to get the best out of Cycles. Further on in the book, you will get to know about animation and still shots, and learn how to create advanced materials for realistic rendering, as well cartoon style shaders. This cookbook contains a wide range of different scenes, proposed in a structured and progressive order. During this journey, you will get involved in the concepts behind every step you take in order to really master what you learn.
Table of Contents (18 chapters)
Blender Cycles: Lighting and Rendering Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Introduction
Index

Creating a rubber shader for the key holder


Now we will create a material for the key holder. It will be a soft rubber material and something completely different from the metal of the key.

Getting ready

Before we start to create the material we need to add it to the mesh. Let's select the key holder mesh, add a new material to it, and name it KeyHolder.

How to do it...

These are the steps we are going to take to create the rubber material:

  1. Now, erase the Diffuse BSDF node from the node editor as we will not use it. Instead, we will be using the combination of Translucent BSDF and Glass BDSF nodes. Add them from the Shader section of the Add menu. Also add a Mix Shader node and link the Translucent BSDF node to the first Shader input and the Glossy BSDF one to the second Shader input of the Mix Shader node. Also set the Fac value to 0.100.

  2. As you can see in the viewport, the key holder now has a white milky material, with the light scattering inside itself. Anyway, to give it a rubber-like look we need to tweak the Glass BSDF node a bit.

  3. Let's change the Roughness value of Glass BSDF to 0.500. Doing so, we will make both the refractions and the reflections generated by this BSDF quite blurry, to resemble the look of a piece of rubber. Also set the Glass BSDF color to pure white.

  4. The last thing we need to do is to set the correct IOR value for the rubber. On the Internet you can easily find information about the IOR (Index of Refraction) of different materials. Rubber for instance has an IOR of 1.5191. Let's set the IOR value in Glass BSDF to 1.5191.

Here is how the final node setup will look like in the following screenshot:

How it works...

A rubber material needs the light to be scattered inside itself. Moreover, it will have a slight amount of reflection on its surface and refractions within its volume.

With the Translucent BSDF node we make the light scatter through the key holder. As we need a touch of reflections and refractions, we will use a small amount of the Glass BSDF node. As both reflections and refractions are quite blurry for a piece of rubber, we increased the roughness value of the Glass BSDF node.

The color of the Glass BSDF node is really important. As we will see, especially in the next chapter, really small changes make a big difference. In order to not make a glass look dark and almost dirty the color needs to be pure white. Even a slightly darker color will not make the glass look good.

There's more...

The Translucent BSDF allows the light to pass through the object and get scattered within. The surface, as in the Diffuse BSDF, is without reflections. On the other hand, a Glass BSDF, as the name tells us, is a shader used to recreate glass materials. While for the Translucent BSDF we can just choose the color, and for the glass we can change the glossiness of the refractions and the IOR. This last value represents the ratio between the speed at which the light travels in vacuum compared to the speed in the object. This is the reason why when we look through a piece of glass we see things distorted. Moreover, the Glass shader generates not only refractions, but also reflections on the surface of the object.