Join George Maestri for an in-depth discussion in this video Creating realistic glass, part of Rendering Using Cycles in Blender.
Now let's take a look at how to create realistic glass using Cycles. This is actually fairly straightforward. There is a Glass Surface that will create a fairly realistic glass. Let's go ahead and start by rendering our scene here. I'm going to go ahead and just turn on Render in this Viewport. And you can see that we've got a glossy table; we've got our oranges. And now let's go ahead and work with the bowl. So I'm going to go ahead and select my bowl.
And you'll see here that we have a Material applied and that the Surface is Diffuse. In order to create glass, we have to apply the Glass Surface. Pretty straightforward. So all we have to do is select Glass and you can see that there's glass. But we've got a number of parameters that we can affect. The first one is the Color. I want to actually see the glass effect, so I'm going to go ahead and take out most of the Color.
I'm going to click on this. I'm going to go to my HSV parameters and take down my Saturation and leave my Intensity at .85. So you can see here that I've got a fairly realistic glass and you can see the oranges through the glass. And now we have a number of other parameters besides Color. We have Roughness and IOR, which stands for Index of Refraction. Roughness actually controls how rough the surface of the Glass is; in other words, it's the frosted glass effect.
At 0 the glass is fairly smooth and glossy and if I bring this up to 1, you'd see how this glass becomes a lot more opaque. Now the reason I'm getting this little speckle effect is because I've got my Render Settings for my Viewport at 10, which just doesn't give me enough to actually go through and fully render this. But I'm doing this for sake of speed of rendering. So if I bring this down to say maybe .5 or somewhere in that range, you can start to see through this.
We have a couple of different models for this. Now this is basically the same as our Glossy Material. So a Sharp value here basically gets rid of the Roughness. GGX tends to amplify it so let's see how that Roughness works. So I tend to keep this on Beckmann, which puts it right in the middle. And in fact I'm going to go ahead and turn this all the way down to 0 again. So we can see this as clearly as possible and make the bowl as clear as possible.
Because the next thing we're going to work with is IOR (Index of Refraction). Now this is basically the lens effect; in other words how much the surface bends light as the light flows through the surface. So by default it's at 1.45. Lower numbers have a lower Index of Refraction. If I brought it down 1.1, notice how the orange becomes more whole. In other words it's bending the light less.
So when it's at 1, it stops bending light completely. This really isn't desirable because it's not creating the glass effect and one of the reasons we see glass the way that we do is because it bends light. So you really want this number above 1. If I put it below 1, say at .7, again, I'm going to get that effect. This is really the difference between bending the light inward and bending the light outward. So at 1, it doesn't bend light at all.
When it's below 1, it bends it one way and when it's above 1, it bends it the other way. For this bowl, values above 1 are really what we want. So at 1.25, you can see we get a pretty good glass effect. As we get higher and higher, it's going to start bending the lights so much that the effect will become opaque. So let's go ahead and just dial this up to say about 2 or 2.4, in this case, and you can see how it becomes almost like a reflective surface.
So again typically between 1 and 2 are good values for this. But you can play with this and create your own effects that may suit your scene better. If you want to, you can mix Glass with other Materials to get other types of effects. So just like we mix the Glossy Material with the Diffuse, we can do the same with Glass. So I'm going to go ahead and take my Glass Material. I'm going to go ahead and add a Node and let's maybe add a Diffuse Shader.
And then we can mix those two together. So I'm going to add a Mix Shader and drop that over that and drop this in here. And you can see that when I do that I'm getting kind of more of a reflective thing and so as we dial this back towards the glass--in other words make my Factor lower--we're getting a much more transparent effect. And if you don't want that, you can certainly delete that Mix Shader out of that Node Editor and just wire it back in the way that it was.
For this final glass, I'm going to go ahead and just add in a little bit of blue color here. I think that will complement the oranges quite well. There we have it. There is some of the ways that you can create glass and other transparent effects using Cycles.
- Controlling interactive rendering
- Using the shader node system
- Adding textures to materials
- Adding bumps and displacements
- Adding primary and secondary lights
- Using ambient occlusion
- Using objects as light sources
- Creating cameras