Have you ever tried to create realistic ice, glass, or a bottle of whiskey, just to discover how frustratingly hard is to get the refraction right? I want to share some tips that help me to create awesome refraction in my renders.
This tutorial is a step aside from classical form principle, which works only if we pretend that the world is made of plaster. Which isn’t the case, of course.
I’ll try to focus on practical tips – what works and what does not, based on my observations and experiences being a nerd.
This tutorial is a part of a Lighting Project – my way to write a book about digital lighting and give value to you.
You are keeping me afloat, and I’m hugely motivated by your support, interest and comments.
1. Ice is What it Refracts and Reflects
When dealing with refractive objects like ice, I find it very productive to think about the world in the first place. Often, ice and glass is nothing more than a glimpse of the world, that peaks through refraction and reflection.
Think of it as the analog of movie editing, but in still picture.
Even when we don’t see environment clearly, the color and value are still there.
Still, ice is what it refracts.
Free HDRi come from iSBL archive, I recommend checking out this resource. In the scene, I used the Ice Lake image.
A common mistake is to tweak transparent material just by changing shader values.
Start with environment, develop the feel. Show what is off screen.
Moreover, reflection on glass and ice is view dependent, so take your time to find a cool camera angle. Or just rotate the object to capture the pretty parts of the world in refraction.
Probably, that’s why hyper-realists love depicting reflective surfaces like glass and car paint: it allows them to open up the world by overlaying multiple dimensions. Ah, they also love wrapping things into transparent plastic and covering it with refractive droplets of water, seen through frosted glass. See the pattern?
2. What Happens to Light Inside of Ice?
Six types of light and material interaction
Let’s see the difference between various types of light interactions. Why? To deal with one thing at a time. To organize the chaos.
The world is not made of plaster. At least, in physically based rendering. A whole lot of exciting processes are going on in the block of ice.
Refraction, anybody? Reflection? Or maybe absorption?
Enough talk. Let’s take this piece of ice and decompose what’s going on in terms of lighting.
A transparent object which doesn’t alter the light that passes through it in any way, will be completely invisible. The reason we see glass is that it reflects the light, and refracts it.
It bends the light.
Imagine whiskey bottle: essentially, liquid acts like a lens. It alters the direction of rays, that passes through it.
Index of Refraction
The refraction of different materials have been given a number value called the index of refraction. The higher the number, the more distorted everything will appear, when seen through the refractive object.
Still water in an aquarium is perfectly clear and we have no problem deciphering fish.
On the contrary, frosted glass has very dispersed refraction. The door in my bathroom is made of frosted glass and I don’t care if somebody will try to decipher me when I take shower. Too dispersed.
When the surface is perfectly reflective (imagine a mirror) light rays bounce of it in a very predictable manner. The angle of incidence equals the angle of reflectance, and that’s it. Light hits, and light is reflected straight.
But objects are rarely so ideal. Small imperfections cause light to be diffused.
Moreover, in case of our ice part of the light gets through it and the other part is reflected. Why does it behave like this? Why is something transmitted, and something is reflected?
To simplify that stuff, I’ll just say that many objects are more reflective the more their surfaces are angled away from the view. On the contrary, metals are not, so they are equally reflective at all angles. In another words, it depends on Fresnel coefficient.
Here you can see how Fresnel reflection at value 1.07 is seen only near the edges of the sphere. And at value 1.3 it starts to fill the whole object.
When light rays hit a matte surface, they get diffused in all directions. In computer graphics, we often don’t perceive it as a reflection at all. Just as a color of the surface. But nevertheless, it IS the reflection, from the standpoint of physics.
In the case of our piece of ice, diffuse reflection is almost non-existent. The world isn’t made of plaster, remember?
Lots of ray tracing, lots of light bending, and almost zero color.
That’s the ice.
Absorption and Scattering
Part of the light is being absorbed, while traveling through the matter. Imagine the piece of ice with suspended sand, sea weeds and plankton. Sure, it will absorb a lot of light and will appear muddy.
Also, some light rays get scattered inside the object to illuminate it from the inside.
We may either fake absorption & scattering effects using Ray Length node in Blender, or try to be cool and use “real” volumetric material on top of the standard one. Your call.
But personally, I find it interesting that trying to stay true to physics rarely pays off.
If it looks like a duck, swims like a duck, and quacks like a duck, then maybe it’s a duck?
Doesn’t matter, how you create the illusion of rays scattering in the ice depths. What matters is whether it looks believable.
Technically, scattering is a part of refraction. But in CG this effect of the glowing ears is best described in terms of Subsurface Scattering. Or just use Translucent shader with Ray Length node plugged in.
Actually, the glowing ice looks a ton more convincing. After all, ice is supposed to have some depth, isn’t it?
3. Variable Roughness Reveals Character
The ideal is boring. As I’ve said earlier, when light passes through an object without any effort, it doesn’t leave a trace. Only when light is partly absorbed, refracted or reflected, we start to notice the disturbance.
Reflection is the case, too.
We need variation.
Variation in roughness can greatly enhance the character of a refractive object. Compare 2 pictures: the perfectly smooth ice and the ice with variable roughness.
4. Caustics: How to Cheat While Simulating Physical Phenomena
When light passes through glass, we can see awesome caustics, that illuminate objects behind it. While it’s no problem to generate caustics using a sphere and 1 light source, it’s much more complicated in real world scene. Huh, now I can’t even get it right on 1 sphere.
You rarely get cool caustics. Fake it.
Light may not travel the direction you want it to travel.
So prepare yourself to do some cheating. Personally, I think it’s okay to fake effects, even trespassing boundaries of physically correct stuff.
In computer graphics, what an object is and what an object looks like are the same thing. So, just throw in some additional lamps with light textures to get the impression of caustics going on and we are good to go.
Bonus Tips for Creating Realistic Ice:
Simulate volume by placing something inside the ice
To create a convincing illusion of depth inside the ice, place something right inside your cube of frozen water. For example, insert another piece of ice.
And add bubbles to spice it up.
Why bother with it? You know, recursive refractions are so awesome.
Shape the ice using Bisect, or sculpt it using the Scrape brush?
If you feel like sculpting, or have been using Zbrush for some time, then you might feel comfortable while trying the Scrape/Peaks brush in Blender. In my opinion, it is the most intuitive way of getting the stone-like shape.
As an alternative, you may use the Bisect tool to cut parts of the geometry. Once again, this tool works just like Clip brushes from Zbrush.
Let’s keep it open and make this book together
I want to keep this Lighting Project open in terms of communication. I need to hear your voice, so please leave a comment and tell me, what do you like/dislike about the article, and what do you want to see in THE NEXT one.