Realistic Glass in Eevee

Creating realistic glass in Eevee is difficult due to the fact that settings are spread out in a number of places and not having good defaults. I also added a custom node to control the direction of refraction and highlights.

Eevee has some limitation with multiple objects, thickness and quality of refraction. The goal here is to have good enough quality for realistic rendering.

Here is example of Cycles rendering of glass from a scene from Definitive Interiors course from @chippwalters.

Using Eevee with a typical Eevee glass shader.

Using Eevee with my custom Eevee glass shader with correct settings.


With this new shader and settings we get refraction through glass and highlights. The thickness of refraction at the base of the glass is much darker. All these improvements matches the Cycle render much closer.

Another Eevee render from a converted Evermotion scene using my custom shader with correct settings.

Tips for creating a realistic Glass rendering with Eevee.

  1. Make cycles render to better visualize glass refraction and highlights to use as a reference.
  2. Screen Space Reflection Settings: enable Refraction.
  3. Screen Space Reflection Settings: lower thickness to “0.1m”.
  4. Screen Space Reflection Settings: trace precision to “1.0”.
  5. Material Settings: Blender Mode to “Alpha Hashed”.
  6. Material Settings: Transparent Shadows to “Opaque”.
  7. Material Settings: Screen Space Reflection to enable.
  8. Material Settings: Refraction Depth to “0”.
  9. Create a Mix Shader node with Fresnel, Glass BSDF and Glossy BSDF. See node picture below:
  10. The Fresnel node control reflection a good range is between 0.5 to 3.0. It is going to vary based depending on the size and thickness of glass. Make sure to start low at 0.5 and increase until the reflection is correct.
  11. The Glass BSDF controls base glass color and refraction direction with IOR. See that is below 1.0 to reverse the direction of refraction a typical value of 0.95.
  12. The Glossy BSDF controls the highlights quality. Base color usually all white and can go above 1. A good value is 1.
  13. Multiple Glass Objects: For the glass objects behind change the Material Settings: Screen Space Refraction to off.

This is a good starting base of Eevee settings for glass. Adjustment may be need depending on the glass type, lighting and scene content.

37 Likes

Thank you for sharing this @eklein. I have a glassware design company so this is great. May I pm you for a little more info?

Thank you for sharing the knowledge on these Eevee topics @eklein , much appreciated. Maybe more will follow after this? :upside_down_face:

Scott,
May I pm you for a little more info?

Sure.

Hi Eric,

Thanks for this.

I was playing around with EEVEE glass tonight, and compared your shader against the one I created at https://gum.co/cwGlass
I see where we both use the metallic parameter to help create a glossy surface. I use a transparent shader while you use the glass shader and I use additive whereas you use the Alpha Hashed mode (I’ve also seen Alpha Blend work well too).

Still, I think it’s a case by case basis and a lot has to do with the lighting and what’s seen behind the glass. Here are two images. The first is using your technique (perhaps I missed something so I included the original cwGlass.blend scene):

As you see, it definitely has a ‘metal’ look to it. (chalise and cylinder and flat table on the right of the scene. The ones on the left of the scene are the old default additive model-- not cwGlass)

Here’s the cwGlass shader

This seems to work better. Here’s the default cwGlass scene. Perhaps you can tweak for your settings. I’m all for a single best glass shader :-). I just don’t know if it’s possible in EEVEE as I suspect it’s a bit of a case-by-case basis.

cwGlass Scene File:
https://filedn.com/lLMW4jXsJqxXkRYjd1UCoKL/Blender/cwGlass-02.zip

2 Likes

Chipp,

The realistic glass works great. I made a change to my node setup to make it work with different types of glass thickness and size. I replace the Principle BSDF with a Glossy BSDF. I updated my Tips Settings above with my new changes.

The cwGlass shader is not realistic. I doesn’t do any refraction through glass and highlights are very inaccurate because of “Additive” blend mode and show back face. Look at my Realistic Glass shader it has refraction through the glass, realistic glass thickness and the reflection highlights are realistic when compare to Cycles.

See image below and attach file without the HDRI with is available from your previous post scene blender file.Glass RealisticNoExr.blend (211.0 KB)

1 Like

Eric,

Thanks for sharing. Yes, you are correct, I need to enable refraction for cwGlass-- it’s such a processor hog and I prefer saving those cycles when doing realtime renders. It really gets my computer singing.

To me, the realistic glass shader is too dark. Looks more like acrylic in the render you show. Not enough fresnel wrapping around the sides. Perhaps it’s the lack of HDRI or just the scene. That’s why I put the curves node in cwGlass, to be able to tweak the amount of fresnel reflection on the object with a single point.

I’ll take a look at your file and new settings.

I do agree that the additive has an issue with NOT having any dark whatsoever. I think your approach may be better, I just need to play with it to see if I can remove some of the darkness. Thanks again for sharing. :grinning:

Chipp,

To make glass color lighter just increase the color of the glass shader it can go higher than 1.

Here is a Cycles render. Even here Cycles has issue with cup refraction. Notice the problems that I describe above with the cwGlass compare with the Cycles.

Here is an Eevee render with update scene file with realistic shader with lighter color glass and higher reflection. Glass RealisticLightNoExr.blend (209.4 KB)

3 Likes

Eric,

Been playing with this all morning. Added a few twists to your earlier, but essentially came up with a very similar look:

This is the best glass I’ve seen so far in EEVEE. Good work.

Ended up pushing the value really high, and adding a curves node to do finally tweaking for the fresnel. I also created a version which can render flat glass planes. This one needs the Transparent BSDF shader.

I learned a lot by looking at your solution. One thing was the Glass BSDF renders refraction, whereas the Transparent does not.

It appears the backface flag does seem to create some ‘dirty bits’ though I’m not exactly sure why. I understand why you adjust the Trace Precsion and Thickness in EEVEE settings, but even if not adjusted, this glass looks good (though obviously Refraction needs to be turned ON or else it does not work.)

If it’s okay with you, I’ll update my free glass shader and rename it ekRealisticGlass (and link to this thread). That way the 1800+ users who have downloaded it can be notified of the new version.

Thanks again. PS… check out the bottle model: Created with 7 vertices :slight_smile:

https://filedn.com/lLMW4jXsJqxXkRYjd1UCoKL/Blender/ekGlass.blend

2 Likes

Chipp,

I added material for the bottle and jar. Same node setup different settings on the Fresnel node going above 1 which in this case it’s closer to the Cycles render. The way you had it the reflection on the side of the bottle and jar are a bit too extreme.

For the flat glass a put a new material node with same setup with different settings. Realistic flat glass has refraction just not as strong as the bottle or cup. Adjust the Glass shader IOR to 0.99 to reduce the refraction.

It’s okay for you to update the free glass shader with ekRealisticGlass.

Here is the Eevee render and adjusted scene with my changes I discuss above.ekGlassTweakNoExr.blend (1.2 MB)

2 Likes

Good stuff. Thanks again Eric!

2 Likes

Hi :slight_smile:

Thanks for this, your glass looks amazing! I think I’m getting somewhere, but I’ve played around with the settings mirroring all the various examples I’ve seen throughout this feed and I don’t seem to be getting any sort of reflectance in the glass.

I’ve been testing it on the vase on the desk, the window glass and all the light and scene settings have been set following Blender Guru’s recent tutorial about realtime ArchViz rendering in EeVee.

Would you have a look at my file and see if you can identify what might be causing this issue?
Any suggestions would be much appreciated, thanks!

https://www.dropbox.com/s/dltajp456ocx4bn/Eevee%20test.blend?dl=0

Amesley,

The key to good looking glass is having good lighting with highlights, reflection and correct shadows.

Unfortunately in regards to lighting an interior scene the Blender Guru’s tutorial is not a good one. Having only a far away area light gives diffuse type lighting and shadows.

I modified the Blender Guru’s tutorial with my workflow for lighting this type of interior scene.

  1. Remove the far away area light.
  2. Added sun light and an area light on the window.
  3. Added reflection cube map tor the room.
  4. Added irradiance volume to the room.
  5. Use my all standard shadow and light settings. (Look at my other post for these.
  6. Adjusted correctly all the other scene settings.

These changes will give this scene a proper sun lit look. Their is highlights and reflection on the glasses. Notice the realistic shadows specially chair legs shadows on the floor and others.

Blender Guru’s lighting:

My workflow lighting:

See attach file without textures. Eevee Interior Glass EKc.blend (4.3 MB)

4 Likes

Also, when outside is brighter than inside, there is no reflection on the window (unless at an extreme glancing angle), so there is no reason for a window or material unless it is a night scene.

Furthermore, while the large texture nodes used are great for cycles, they can cause delays in EEVEE gpu processing.

1 Like

Hi Eric,

Thanks so much for this, as a newbie it’s great to be able to come on here and get really helpful, in depth responses to issues :slight_smile:

I will go through everything you’ve said and try to recreate it!

Thanks again

Agree having separate large textures for every channel including roughness, reflection and normal for every object in the scene is unnecessary and use large amounts of GPU memory and slows down Eevee. It is specially important to be efficient in large scenes with hundreds of materials. This is one of the good things about your “Definitely EEVEE Materials System”.

In windows facing the outside even when the environment is bright I do use some reflection. I like to use “thin glass” shader by using my glass shader setup and replacing the “Glass BSDF” node with a “Transparent BSDF” node. Objects close the window will reflect back into the window. This gives a more realistic interior. What is not needed is refraction which can cause some Eevee artifacts.

Here is example of using small amount of reflection on a window from my one of the scenes from Chocofur from my “Realistic ArchViz” series see the link Window Reflection.

Amesley,

Your are welcome. Their many good examples of good lighting setups in Eevee for glass that can review in my series of “Realistic Archviz from Cycles to Eevee” see this Link. Look at this lighting setup for Eevee that I did in this series from the an Evermotion scene:

1 Like

Playing with this now after trying to make the original cwGlass coloured in order to make a lightbar for an ambulance, and it seems like rather than changing the colour of the glossy shader, which just makes all the reflections tinted red, it’s the glass/transparent shader that should be tinted:

Doesn’t seem to work properly on the wine glass though, for some reason…

Tedri,

I made a new shader call ekRealisticGlassColor.

  1. Added a color node.
  2. Added new nodes that control the fresnel reflection color and better reflection.
  3. Flatten RGB curves as a default starting point.
  4. Improve quality of glass reflection by adding reflection cube map to each glass object.

New node setup:

A render of the new node setup with different colors:

2 Likes

Chipp,

Here is an update blender file of the ekRealistic Glass Color shader in your scene without HDRI if your interested. Need to bake before rendering. ekGlass1ColorNoHDRI.blend (274.8 KB)