Colored glass in cycles

I’ve been experimenting with colored glass in cycles for a while, and i found out that mixing a colored Volum Absorbation-shader with clear glass makes a pretty sweet and realistic effect. If you have any tips and/or tricks for good glass-materials; feel free to share them!

Here is what i came up with :slight_smile:

Nice. It is more realistic. I think absorbtion is actually how it works in the real thing (since glass is a solid), the original Cycles glass coloring itself being a bit more “hacky”. So now that we have volumetric absorbtion, no excuse not to do it other than the cost of extra rendering time.

Might want to cross-post this with that epic Cycles materials thread if you haven’t already.

Can you show me the nodes please?

The nodes are very simple. For the ones on the image i used only Glass and Volume Absorbation

I recently found out that adding a little tint to the glass makes it lokk a little bit better, so you might add this;


This is a great tip, I would also like to add, setting the ior to something like 1.6 -1.7 gets a better glass looking material, from trial and error. It may not be physically correct though.

Very helpful. Thanks!

You can also use the raylength data type from the lightpath node if your scene doesn’t need any reliance on an actual volumetric effect (such as volumetric fog inside the glass or an object encased within).

It might be quicker if you do an animation or something, but I’m one of those who like to minimize the amount of shortcuts taken if it’s practical.

What do you set to get the shadows to reflect the color of the object? I copied the setup that Monsaki showed but my shadows are opaque and grey.

Perhaps you have the refractive caustics option disabled?

I checked, but that wasn’t it. Good suggestion though.

I figured out how to fix it. But now, in retrospect, trying to compare the good and bad files to see where the difference is, I’m drawing a blank. Oops.

Glass is a dielectric. If color goes into glass shader color, shouldn’t it at least fade to white towards the edge?

Try a newer build, Sergey fixed a major issue with the rendering of refractive caustics that first appeared about a year ago (causing the engine to reject almost all samples taking that kind of path).

One important optimization for this setup is (if the absorption color is uniform) to set the material to Homogeneous. The result is just a bit slower than a pure colored glass.

I ran both files on 2.75a. One still works, one still has opaque shadows. :o