Vray Materials Part 4 – Refractions

18 01 2012

For those who aren’t keeping up, I have gone through a brief explanation of the differences between reflection and refraction in my previous post.  But to review, refraction is the visual distortion that occurs as a result of a transparent or translucent material having some level of density to it.  The light waves are deflected or change angle between the top surface of the material and the back surface.  As a result, any object that you apply a material with a refraction layer to MUST have a thickness.  Otherwise, the computer will try to calculate this difference, but be unable to (think of it as dividing by 0) and freak out, resulting in a black output.  As a side note, you will notice that adding a reflection layer and/or a refraction layer will cause an increase in render time because of the increase in computing the machine is asked to do.  It now must not only calculate the lighting and material, but also the way in which the light/materials reflect or refract and what will be seen as a result.  It’s just something that needs to be kept in mind, especially when working with large scenes, tight deadlines, slow machines, and impatient clients/bosses.

Refraction:

Refraction is often found in conjunction with reflective surfaces, think of a window that you can both see through and has a reflection, so it is most likely the case that you will add both a reflection layer and a refraction layer to your material.  I’m going to start by simply adding those two layers to a brand new material I’ll call “Refraction layer”.

When I apply that material to the scene, I find that our initial rendering shows the highly reflective material, but no refraction.

Let’s remember that in order to see the refraction, we are seeing through the material.  How do we see through a material?  The  diffuse transparency!  Right now, it’s showing as black which makes the object 100% opaque.  Let’s change this to white, making it 100% transparent and there we go!

It’s important to make sure that you change the transparency color on the diffuse layer, not on the refraction layer.  We want the overall object to appear transparent, not the amount of refraction.  I will be sure to explain this further later in this tutorial.  Looking at our rendering we can see that these objects, specifically the sphere are beginning to show a bit of distortion and look very glass like.  To accentuate this, I’m going to change the floor material to a check board pattern and re-render.

With the new rendering we can better see how the materials both reflect the light (which is why the pyramid to the left is all white…it’s reflecting the direct light at a harsh angle) and refract the light.  Now that we understand what these features are and how they work and are applied to materials, let’s look at how to better control the features of the refraction layer.

IOR:

The IOR as it deals with refraction will increase the amount of distortion in the material as the IOR increases.  It’s important to keep in mind that the IOR for refraction and reflection are different, however for the most accurate results they should be the same.  A few good values to keep in mind according to the Rhino Manual:

Vacuum = 1.0          Air = 1.00029          Alcohol=1.329          Ice=1.309

Water=1.33          Glass=1.517 (I like to use 1.42)          Crystal=2.0          Diamond=2.417

 For a full list of IOR listing, check out http://en.wikipedia.org/wiki/List_of_refractive_indices

Below I have borrowed a matrix created by Chia Fu Chiang and Damien Alomar that shows an incremental increase in IOR and the amount of distortion.

Matrix part of Vray for Rhino Manual by Chia Fu Chiang and Damien Alomar

Glossiness:

Similarly to the IOR, Glossiness is a  parameter in both Reflective and Refractive layers.  The difference between the two is that the Reflective Glossiness deals strictly with the amount of reflection dealing with the surface.  The refraction glossiness will have an effect on what happend inside the material, therefore having and effect on the transparency.  It’s through this parameter that the materials can appear frosted.  The refraction will become more blurry based as the Refraction Glossiness decreases.

Again, below I’m borrowing a matrix from the Vray for Rhino Manual.  The matrix below sets the IOR at 1.55 but changes the Glossiness.  It’s important to see that the transparency changes rapidly between a glossiness of 0.80 to .75.

Matrix part of Vray for Rhino Manual by Chia Fu Chiang and Damien Alomar

Fog

The Fog parameter allows you to give a refractive surface a tint of color.  This can be useful when attempting to create a tinted glass, blue, green or otherwise.

I have added a color (63-191-191) to the fog, see settings below:

Notice how the color is added to the material.  The strength of the color depends on both the thickness of the material and the fog color multiplier.

Notice that certain geometry above appears to have black refraction.  This has to do with the “Exit color” and the Abbe number of the Dispersion.  These are new parameters to VfR 2.0.  I will go over all of the new features in an upcoming tutorial.

Below is a sample of the fog multiplier color number.  From left to right the number is 0, 0.2, 0.5.  It’s clear that the higher the color multiplier, the more more the color affects the material.  As a side note, I find that for a tinted glass, a fog number between .15 and .4 generally work for the my taste.

2" thick glass - Fog Color Multiplier L to R (0, 0.2, 0.5)

General Settings

Options

The two parameters that I’ll discuss in this tutorial is the “Affect Shadows” and “Affect Alpha” options.  The “Affect Shadows” does what the name would suggest.  It uses the color and refraction to affect the shadows being cast.  This will give the shadows a hint of the color of the glass or refractive material.  The “Affect Alpha” option also is fairly straightforward and affects the alpha channel, giving a colored tint to the alpha channel.

Affect Shadow only L to R Fog color (0, 0.2, 0.5)

Affect Alpha only L to R Fog color (0, 0.2, 0.5)

Affect Alpha + Shadow L to R Fog color (0, 0.2, 0.5)

Translucency

Again, because I feel the need to be 100% honest to you, my loyal readers, I must disclose to you that I have a tough time with the Translucency parameters (and considering I haven’t been able to find anything online that really makes sense, I feel that you don’t get it either).  I think that I struggle primarily because the numbers mean absolutely nothing and as far as I can tell just are a value relative to each other.  However, in an effort to gain your faith back, I will tell you know I do know or have figured out for Translucency.  This type of material is often referred to as Sub-surface Scattering material (SSS)

Translucency will have an effect on the material, allowing light to penetrate through the material based on the thickness of the material at a given point.  As a result, this is a very helpful material type to use for wax, skin, milk, plastic, etc.

1)  Always change the IOR to 1.0

2) Change the transparency away from pure white.  Try value 80-150.

3) Uncheck Double sided material under “Options”

4) Lower the Refraction Glossiness to something under 1.0

5) Be careful that your light is properly adjusted to ensure material appears as desired.  A light that is too strong will not give the desired effect, and will appear washed out.  A light that isn’t strong enough will not properly penetrate the material’s surfaces, giving it a dark or black look.

Translucency with Value 80

Please follow back up and check out my Research section.  As I have more time and will investigate some of these parameter, I will post it there, giving us all a better understanding of the stuff I haven’t fully explained here.

Coming up next:  Lesson 5 – Emissive Layer