Glass in cycles - what is your best approach to glass material?

So again I had some problems with glass material for my recent project - in the main blend file it looks OK but when I link it into the archviz scene the object is really dark. (we’re talking cycles here)

I’ve been encountering problems with ever since I started with Blender, always getting different results. So here I am asking you - what is your solution for perfect glass material?

Is it Principled BSDF transmission set to 1, color to FFFFFF, roughness to some low value like 0.01? (I’m using this mostly for close-ups, product renderings)
Maybe you’re using PBR2 from Remington graphics?
Or you invested in material library, Vmats?
Maybe you decided that the best approach is to mix glossy & transparent? (this I’ve found most reliable)

Curious to hear from you.

PS I understand that different models call for different solutions but maybe you can provide some info on what you’re using and when.

I do fresnel to mix refraction and glossy with volume absorption. Mix in via light path/isShadowRay a transparency shader whose color is driven by layer weight that looks like glass fresnel - I don’t rely on caustics to do the light transport. For window sheets, I use thin geometry and layer weight -> curves to look like fresnel, to mix between transparency and glossy.
Glass going dark is usually due to relying on caustics - so do the light path trick above to remedy that, or because normals are not pointing the right way or messed up in some other way.
I also make sure I have some gap between a glass object and the surface it rests on.

I’m not an expert, but these are some of the things that I do when Glass in Blender looks bad (it is very likely that some of them are not the best approach to apply, but they work for me)
If the material looks dark, you can go even further than the Color slider allows you when it comes to clarity. If you manually enter the values, for example in HSV mode, in V field you can manually enter values greater than 1 (1.2 for example).
If you are using limited bounces under Lights Paths, you may get dark artifacts in Glass. It will help if you increase Max bounces, and Glossy (especially), Transparency and Transmission bounces.
Whenever possible you use Solidify modifier, this will help you in many cases to make the glass material look better, especially in glasses that are not closed volumes, or those volumes that should not look as if they were all completely solid glass (a test tube, a soap bubble, a glass fish tank, etc.)

But for archviz (Windows, etc), I know that people usually use approximations like those described by @CarlG to “fake” glass.

You’re breaking energy conversation here. Be very careful as you can end up with amplified fireflies.

OK, thanks for the warning. I have not noticed any problems the times I have done that. Do those fireflies come from direct or indirect light?. In default Blender we have Clamping indirect light=10. Maybe it helped so that I didn’t notice any problems.

I don’t clamp as I work with (what I believe to be) physical values.
I haven’t had much issues with excessive fireflies since I started using new denoiser.
Hmm, I think the clamp setting should be reconsidered if the new sun & sky texture is overbright at exposure 0.

I’ve made some tests and I have no idea why sometimes Principled looks better. Normals are fine, model may be a little bit wonky at the top but nothing major.

Every material has the same ior (1.5 for glass) and roughness (0.027) and color (FFFFFF)

1 - PBR2 from remington
2 - Glass BDSF
3 - ‘physical glass’ from here: https://odederell3d.blog/2020/04/10/rendering-transparency-irregular-volumes-vs-glazing-physically-correct-rendering-vs-effective-cheating/
4 - principled BDSF transmission 1

I’m leaning towards 3…

@CarlG is your refraction/glossy setup similar to what I used for #3? (https://i1.wp.com/odederell3d.blog/wp-content/uploads/2019/12/cycles-1.jpg?ssl=1 - the one on the right)

Yeah, except in addition I shader mix in transparency at the end, using light path/isShadowRay.

Are you using official Blender/Cycles? Does the same happen if you don’t use texture maps in the shader?
I don’t have that difference between Principled and Glass shaders regarding darkness in simple scene:
principled vs glass.blend (172.5 KB)

1 Like

Welp, turns out I might have missed something. My color wasn’t switched to FFFFFF… Getting through all the settings one by one helped, don’t know why I missied it.

1 Like

Oh ok. It happens that sometimes one confuses Subsurface Color with Base color picker. Maybe that happened.

with PBR is there a way to see in viewport transparent glass ?

i know how to do it for normal glass but how to for PBR ?

thanks
happy bl

You mean Material View, right? Material view is always Eevee, no matter you have Cycles engine selected. So you should switch to Eevee engine and configure it properly. For Transmission in Eevee, you must enable “Refraction” under “Screen Space Reflections” in Render Tab. In Material Tab you should enable “Screen Space Refraction” and the corresponding “Blend mode”, and maybe some more tweaks.
Then in the Viewport Shading drop-down menu (marked as “A” in the .blend file that I share below), it is recommended that you enable Scene Lights and World. Now you can switch back to Cycles engine and you will be able to see Eevee glass in Material View mode:
principled vs glass_Eevee.blend (182.7 KB)

Keep in mind that transparencies/refraction in Eevee have many limitations, this will not always look quite right.

will test that

so you mean that for PBR you cannot have a transp mat in viewport
like normal glass in cycles !

i work on a tube and with PBR i get some very darkish on bevel corner
not certain if this is normal
will test other glass type to see if i get same effect

does PBR mat has refraction effect with caustic or none at all ?

thanks
happy bl

Eevee has no caustics at all for now.

Maybe you should look for some nodes of some other users who have managed to get some good faked caustics for Eevee.
Note that for that case, you on material nodes can configure a combination of different nodes for Eevee and Cycles. So for Eevee glass nodes you must configure Material Output node for Eevee from this node drop down menu. Similarly do it for Cycles nodes.

Here’s a great talk about glass :wink:

I see this, not test for now. Maybe someone miss this post.

Thank you Kate! From this lecture I went straight to Lech Sokolowski lecture about architecture rendering which was also really informative. I’ve prepared for myself three nodegroups, that are pretty awesome for every use. One for thick glass with colored rim, one for slim glass panels (only reflections) and main glass with the one from the article I’ve specified earlier. Everything works like a charm. Nodes for those interested below.

Main glass:

Slim glass panels material (windows; only reflections, use curve to control visibility):

Glass with colored rim (for thicker objects like thick glass tabletop):

2 Likes