Realistic Eevee Glass And Liquid Shader

by Orange Turbine in Surfacing


Installation

To use the CGC Eevee Glass Shader:

  • Append the shader to your scene by going to File / Append, navigating to the CGC_Eevee-glass.blend file, choosing 'NodeTree', and then selecting 'CGC Eevee Glass'. 
  • In the Shader Editor, add the node by going to Add / Group / CGC Eevee Glass
  • Make sure both the Blend Mode and the Shadow Mode for the material are set to Alpha Hashed
  • Make sure that Backface Culling is off and that the Refraction Depth is set to 0. 
  • Turn on Refraction in both the material settings and in the render properties under Screen Space Reflections

Color

The color of the glass can be controlled by changing the Color input. This will only tint the refractions and not the reflections. 

Alpha Hashed materials cannot have colored transparency, so by default the Alpha Hashed Color Fix value is set to 1, which prevents the color from needlessly darkening the transparency. You can lower this value if you wish to darken the transparency or are using an Alpha Blend material instead. 

There is also an option to tint the reflections, even though it's not considered physically accurate, just in case. 

Absorption

Volume absorption doesn't quite work for most objects in Eevee because it will only take the shape of the bounding box of the object and not the actual shape of the mesh. The next best thing would be a Subsurface Scattering shader with a really high scale, but SSS doesn't work with non-opaque objects. To get around those limitations, I'm using a 50/50 mix of a diffuse and translucent shader, which results in a completely flat material that still responds correctly to the light in the scene - unlike an emission shader or simple diffuse shader. 

Increasing the Absorption slider will make the diffuse/translucent mix spread throughout the glass, starting from the center of it's bounding box. To change where the absorption is positioned, you can edit the Texture Space location and size of the object in the Object Data Properties. 

Alternatively, you could add the Absorption Shift mapping node's inputs inside the node group to the group's inputs so that you can change the location, rotation, or scale from outside the node. 

Roughness

This changes the roughness of both the reflections and refractions. 

Inner Refraction

Setting the Inner Refraction to 1 will give you a glass material that only uses refraction, while setting it to 0 will make it only transparent glass with the exception of the Edge Refraction. 

I've found that it's best to tweak this depending on the scene. A higher value is great if you do not care about seeing other glass parts or objects behind the object, and a lower value is great if you do. 

A value in the middle will produce a double-vision type side effect where you'll see both the distorted and non-distorted versions of anything behind the glass. This can be totally fine and easy to overlook in some circumstances and annoying in others. Use at your own discretion. 

Note: when using Alpha Hashed materials, changing this value will change the apparent saturation of the glass, since only Alpha Blend materials can be colored.

Edge Refraction

A common problem with transparent or partly-transparent glass is that you'll see both sides of the wall of the object - something that could never happen with actual glass. 

Edge Refraction allows you to add refraction only along those glancing angles, so that your glass appears to be one solid piece and better defined along the edges. 

Thickness

The Thickness control changes the IOR of the glass. I've opted to not expose this as an actual IOR value, because unless you're applying a glass material to a cube or a sphere, the value or any shader in Eevee isn't going to be physically correct anyway, since it relies on the bounding box size and not the mesh itself. Eyeballing it is much faster and gives a better result.

Dispersion

Controls how much difference there is between the IOR of the red, green, and blue refraction shaders for a colorful effect. 

Shadow Opacity

Lighten the shadow if you find it to be too dark. Alternatively, you could set the material's shadow mode to Opaque or None. 

Normal

Plug in any normal maps here, just like any other shader. 

Sales 500+
Customer Ratings 2
Average Rating
Dev Fund Contributor
Published almost 4 years ago
Blender Version 4.1, 4.0, 3.6, 3.5, 3.4, 3.3, 3.2, 3.1, 3.0, 2.91, 2.9, 2.83
License Royalty Free
Have questions before purchasing?

Contact the Creator with your questions right now.

Login to Message