- Given that glass is one of a handful
of material types that we come into contact with
probably on a daily basis, the likelihood
that we will need to recreate it in some way
on one of our projects is quite high.
And compared to older shaders such as 3ds Max's
standard material, the V-Ray material makes creating
a variety of realistic glass types a very simple process.
In this exercise, we're going to focus
on creating a basic glass shader
for our champagne glasses here,
one that could be used as a jumping off point
for something a little more complex.
Let's open up the Material Editor then,
and as we did in the previous exercise,
create a new workspace tab, calling it "Glass",
to which we can then add a new V-Ray material,
calling it "Champagne Glasses".
We then want to select the glass geometries on our shelf,
and apply the new material to them.
Now bearing in mind that the V-Ray material
is an energy conserving material type,
and given the fact that the glass
is both reflective and refractive,
the diffuse coloration controls in the V-Ray material
won't be making too much of a contribution
to the final look of our shader.
Even when we create colored glass,
it isn't these diffuse controls that will
provide the color information.
These affect only surface interaction with light,
whereas the coloration seen in real glass
is created by light interaction on the inside of its volume.
One of the most obvious aspects of many glass materials,
of course, is the fact that they are see-through.
In the V-Ray material, this property
is most realistically reproduced
by means of the refraction controls.
Now do bear in mind, that the reflection and refraction
sections in the material do look somewhat similar.
So just make certain that you are working
in the correct area before going ahead
and making any alterations to the parameters.
The main control that decides the extent
to which the material is perceived
as being see-through or refractive,
will be the "Refract" color swatch that we see here.
Black keeps our material, or more accurately,
the object to which the material will be applied,
completely opaque or solid-looking.
Whilst at the other end of the scale,
white will make it completely refractive,
and so, see-through.
As I'm not a lover of using extreme number values
in any aspect of my material creation,
given that such extremes are very rarely found
in the real world, I'm going to set
a value of 245 here for my refraction color.
Of course, glass is also highly reflective,
so we will need to come to the reflection controls
and set our "Reflect" color swatch
to pretty much the same grayscale value.
What we get if we take a render of the scene now
is both a reflective and refractive material.
We get this because by default these days,
the "Fresnel reflections" option that we see here
is enabled in the V-Ray material.
This tells V-Ray to balance or blend
the material's reflectivity versus its refractivity
based on the angle at which that material is being viewed.
In other words, when we render
an object from glancing angle,
we will see greater amounts of reflection.
But if we instead render it straight on,
then we will see greater amounts of refraction.
Given of course, the ability
to see straight through an object.
Without this Fresnel option enabled,
as was the case by default in versions
earlier than V-Ray 3.0, we would get
a completely different result.
As can be seen if I just un-check this,
and perform a region render of the glasses.
What we get now, looks much more akin to a chrome goblet
with no refraction appearing to take place.
As this is clearly not what we are wanting to create here,
let's go ahead and check the Fresnel option again.
Now although we can't really tell
from this particular camera angle,
one thing we aren't getting at this moment in time
is correct light penetration of our geometry volume.
In other words, we don't yet have
physically correct transparent shadows.
In fact, let's just switch to a perspective view here,
using the P-key, and then using the middle mouse button,
just frame up on our glasses.
What I want to do is select one of them,
and then drag it to the front of the shelf
so that it is sitting in direct sunlight.
If I go ahead now and take a render,
what we get is a completely solid shadow,
as if coming from a completely opaque object.
The parameter we need to enable
in order to change this is the "Affect shadows" option,
found in the refraction controls.
If I put a check in that and then region render
the glass and its shadow again,
we now get something that looks much more
physically correct for the type
of glass that we are rendering.
Let's just put the glass object back where it belongs,
and then make one final tweak
to our material for this exercise.
At this point in time, I'm thinking
that the glass material looks a little
too milky for my liking, so I'm going
to come back to the "Diffuse" color swatch
and set the value here to an almost black.
Something around about a value of five should work nicely.
If I then hop back into my original rendering camera,
and hit the "Render" button, we now get something
that just looks a little darker.
Almost adding a bit of a smoked glass look to the shader.
The V-Ray material then makes the creation
of simple refractive material such as glass,
a very easy for us to accomplish.
What, though, if we wanted something
that was a little more complex?
Something like a colored or even frosted glass for instance.
Well let's move on to our next exercise
where we can take a look at how we would
go about creating those very effects.