You want to create a glass material for your game project and are using the Eevee render engine in Blender to preview your materials. But you come across a problem, the glass shader that you created does not behave like glass at all in the rendered view. So how do you fix this?
To create the correct behavior for glass in the Eevee engine, go to Properties > Render > Screen Space Reflections and tick the box to enable reflections based on the view of objects on the screen. Open up the panel and you will see the option to enable refraction, tick that box as well. Then go to the material tab and under settings, tick screen space reflections.
Glass is one of those materials that are more difficult to create in the Eevee render engine than they are in cycles because of the added steps that are required to get the same behavior, the question though is why?
Why is Creating Glass Different In Eevee Compared To Cycles?
The two render engines that are used in Blender to render scenes are very different in both their design and purpose, which each render engine having its own set of use cases.
The Eevee render engine is an online renderer where the scene is produced in real-time, similar to a game engine.
The Cycles render engine is an offline renderer that compiles data for a scene to produce a more realistic image over time.
Many of the principles that materials and lighting follow in the real world are replicated using the Cycles render engine. It is very easy to create something that looks real in cycles if materials and lighting are used correctly.
But these principles, like refraction, for example, are very processor intensive and are not always suited for online rendering unless you begin to cut corners elsewhere.
Glass needs to be able to both reflect light and refract light which can be done in Eevee by using screen-space reflections. This involves calculating reflections based on objects that are already visible for the current view or render.
This is not required in Cycles where light is calculated with light bounces and the principles of reflection and refraction are enabled by default with the engine.
Using The Correct Settings?
There are only a few settings that we will need to change for our glass to adopt the basic principles of reflection and refraction.
First, we need to set up the render engine to be able to use screen space reflections so that it can allow materials to reflect other objects.
To do this, go to Properties > Render > Screen Space Reflections and without even opening it up you will see a tick box next to the label. Tick the box to enable screen space reflections.
Then open up the menu for screen-space reflections, and you will see an option for refraction that is currently not ticked. Tick this box to enable objects to include refraction in their rendering process.
While any reflective objects will now reflect other 3D models, they may still not be refracting light.
Go to the materials tab, and create a material for your object, naming it glass. You can create a simple glass material one of two ways.
The first method is to turn down the roughness value of the principled shader and turn the transmission value all the way up to one.
The second method is to replace the principled BSDF shader with a simple glass BSDF shader.
Regardless of the shader that you choose for your material, scroll down in the material tab to where you have the settings and tick the box with the label Screen Space Refraction.
Finally, adjust the Refraction Depth to something that is slightly higher than one.
Can I Get Glass To Look Identical Between The Two Engines?
While you can closely mimic the behavior of glass in Eevee and Cycles, it’s very hard to get a glass object to look exactly the same in both engines.
This is not down just to the material settings of the glass but also how light is calculated in each engine. Light plays a crucial role in expressing a material or texture. Bad lighting can make an otherwise realistic material look fake and vice versa for good lighting.
There are further settings under-screen space reflections that will allow you to slightly adjust the behaviors of the glass, but they won’t get very far in terms of matching cycles.
Advanced users are able to produce fantastic-looking glass materials even using Eevee, but this requires a lot of nodes and a lot of time.
So it is possible, but if you are going to go to the trouble of trying to create realistic materials in Eevee, then it may be a better option to just use Cycles.
Will Changing The Blend Settings Help With Glass?
In the materials tab, we can adjust the settings for the material, such as the blend and shadow modes. Are any of these settings important to our glass shader though. Well, the blend mode allows for transparency when working with materials, but this is not to be confused with the transmission, which is what is used to calculate light passing through our glass.
As such, changing the blend type will not affect the glass shader unless we use the alpha blend option, which makes the polygons transparent depending on the alpha channel. Even then the physical difference is negligible and so it’s best to test this on a case-by-case basis, but no, it’s not needed for the glass material in general.
The shadow mode is the way shadows are calculated using the material. In Eevee these options all produce very dark shadows, therefore turning shadows off for this material may actually be preferable in some scenes even if it is not realistic.
Enabling screen space refraction here is required for the material to match the setting enabled in the render tab. You need to make sure that this object is ticked unless you are using a special shader (see below).
The refraction depth is an important parameter that should not be overlooked. In the real world all objects have at least some level of thickness, and for glass that thickness can influence how light is refracted as it passes through.
In Blender, our faces have no actual thickness so the behavior of the refraction is not correct. By increasing the refraction depth we can approximate the thickness of our material so that the light behaves correctly.
We recommend setting this to a very low value depending on the type of glass that you are making, keeping the value between 0.001 and 0.01, and then increasing it only if you are looking for a certain look.
Are There Add Ons Or Nodes That Can Help Create Glass In Eevee?
In Addition to the ability to reflect and refract light, there are other principles as well for creating realistic glass, and while Cycles comes a lot closer to true realism, even it does not create perfect glass that easily. fortunately the issue of creating glass in Eevee is so common that someone designed to create a new shader for creating glass in Eevee.
This shader can be found on blend swap here and allows artists to create glass materials that follow real-world principles such as light refraction and caustics much more effectively than the standard glass shader.
The shader is free but there are two small caveats, the 1st being that you require a login with blend swap to download any file (Takes a minute to setup), and the second is that the file is a blend file, meaning you are downloading an entire project and not just the shader.
Newer versions of Blender will have an asset library that you can save any data block to and use that data for any projects that you want. You can mark your data blocks as assets in a shared folder and then drag them into new projects.
Thanks For Reading, Here Are Some Other Topics Of Interest…
Thanks for taking the time to read through our article, here are a few more that we think you may be interested in.
- How Do I Speed Up My Render Times In Cycles And Cycles X?
- How To Make Your Background Transparent In Your Renders?
- How To Apply An Image Texture To An Object?
- What Is The Index Of Refraction Of Glass?
- Do I Need To Use A GPU To Use Blender?
Depth Perception: Adjusting View Focal Length for Better Renders
Adjusting the view focal length in Blender can dramatically improve your renders. Learn how to manipulate depth perception for more realistic scenes.
Cursor Control: The Ultimate Guide to Using the 3D Cursor
Harness the power of Blender’s 3D cursor for precision modeling and editing. Place, pivot, and snap with this versatile tool.