Join Donovan Keith for an in-depth discussion in this video Creating glass using transparency and refraction, part of Cinema 4D: Creating Materials.
In this video, we'll use the Transparency channel and the Refraction setting to create a glass surface. Let's start by creating a new material. Go to Create > New Material, and let's rename this material Glass. Go ahead and double click to open up your material. I'm going to turn off the Color channel because this is a transparent object and it's getting most of its light just from its transparency. I'm going to now turn on transparency by clicking on the check mark next to transparency. Next, let's adjust our specular settings. So click on the Specular channel.
And let's just go ahead and bring down the width because this is a hard surface. And increase the height. Depending on your scene you may be able to turn off the specular all together. Now let's go back to the Transparency channel. Inside of Transparency is a setting called Refraction, and this is really the heart of any good transparent material. Go ahead and set refraction to 1.6. Now you may wonder one, what is refraction and two, where did that number come from? Well, I want to remind you of a really great feature in Cinema 4D which is its online help. So if you right click on any setting in Cinema 4D, you can choose Show Help, and that will bring up the page in the manual.
First, I see a list of useful refraction values, and one of these is Glass. We see that glass has a refraction of somewhere between 1.44 and 1.9. I just chose 1.6 because it's somewhere in the middle. Now if we want, we can also take a look at what refraction is, and there's a little illustration here. Imagine this arrow is a ray of light, entering a spherical surface. As it enters, it enters a surface that has a refraction index of 1.5, and it's being bent.
Now, as it exits that surface, it's being bent again. And a refraction index of 1.0 is the same as air which as far as we're concerned doesn't really bend the light at all. Now back at our scene here, we've created a glass material. Let's just apply it to our teapot and give it a render. And what we get is something like this. It's looking pretty good considering the amount of effort that we've put in. Now, the issues that I'm seeing are a lot of aliasing at the tops and bottoms of my teapot.
Basically those areas where there's a lot of refraction sort of piling up on top of itself. In order to improve the look of all transparent materials. What you need to do is go into your Render settings, go to the Anti-aliasing tab and change anti-aliasing from Geometry to Best. The default settings I believe are one by one and four by four. And while that will help some, that won't completely correct a lot of the more intense refraction problems. So to correct those, instead of cranking up the settings for my scene as a whole. What I'm going to do is add a compositing tag to my teapot. So I'm going to select my teapot, right click and choose Cinema 4D Tags > Compositing.
Once there, I'm going to go into my Force Anti-Aliasing setting and check that. The minimum is one by one and four by four. I'm going to crank this up a bit to say four by four and eight by eight. Now this will slow down the render of my glass. But it will not slow down the render of anything else which is quite nice. Now for me this might be a little bit too slow, so you can continue to play around with these settings. Now there are a couple other settings that I want to show you in the glass material. One of them is something called Total Internal Reflections. And what this does is it allows you to create effects sort of like fiber optics. Where light can get trapped inside.
And then there's this Exit Reflection Setting. Now, both of these, if left on, give you a more realistic glass. But for the purposes of say advertising, you sometimes want to remove extraneous reflections and for me Exit Reflections will do that. That'll just sort of just clean up the appearance of your material. So I'm going to turn off Exit Reflections and let's just do one final render. Now, we did have a wait a little bit longer for this to render, and I'd say there are still a few anti-aliasing issues around the area of the lid.
But all in all, I'd say this is a pretty solid looking glass and it doesn't take much effort to get a really great looking image. With the correct transparency settings, realistic glass is surprisingly easy to recreate.
- Applying materials to objects, NURBs caps, and polygon selections
- Creating glass using transparency and refraction
- Building colorful backgrounds
- Creating plastic, metal, and concrete
- Mapping an image to a video screen
- Adjusting material placement
- Creating layered materials with photographs and the Filter shader