Every Trick for Shading Glass in Eevee - Fundamentals of Blender Materials & Shading (Bonus Video)

CG Cookie
16 Sept 202026:23
EducationalLearning
32 Likes 10 Comments

TLDRIn this informative tutorial, Jonathan Lampell from CGCookie.com dives into the intricacies of creating realistic glass materials in Blender's Eevee rendering engine. He addresses common issues with the default glass BSDF, such as excessive distortion and lack of refractive visibility through other objects, and presents a custom shader solution. The video offers an in-depth look at the shader's construction, material settings, and techniques like transparent shadows and refraction control. Lampell also discusses the importance of user-friendly controls, dispersion effects, and absorption for more natural-looking glass, providing a comprehensive guide for artists seeking to enhance their rendering skills.

Takeaways
  • πŸ”„ Creating realistic glass in Eevee is challenging due to the lack of light ray bouncing effects, leading to the need for faking certain visual aspects.
  • πŸ“š Jonathan Lampell from cgcookie.com explains how to create a better-looking glass shader in Eevee compared to the default settings.
  • πŸ” Eevee's glass BSDF has limitations, such as excessive distortion and the inability to see refractive objects through other refractive objects.
  • πŸ”§ The shader tutorial covers material settings, including turning down the IOR or setting a refraction depth for more control over the glass appearance.
  • βš™οΈ The refraction depth setting in Eevee is problematic as it cannot be adjusted per material and tends to copy the original material's setting.
  • 🎨 The custom glass shader omits IOR control and instead uses a thickness control for flexibility in achieving different object thicknesses.
  • 🌞 Transparent shadows are a feature of the custom shader, which are not available with the default glass BSDF in Eevee.
  • πŸ“ The importance of settings such as backface culling being off, blend mode set to alpha hashed, and shadow mode set to alpha hash for proper rendering is highlighted.
  • 🌟 The tutorial includes a step-by-step breakdown of the shader's creation, including the use of transparency and refraction to achieve the desired glass effect.
  • πŸ› οΈ The node setup for the shader is explored in detail, including the use of mix shaders, fresnel for reflections, and layer weight for a more natural look.
  • πŸ’‘ Additional features like absorption and caustics are added to the shader to enhance realism, with tips on how to implement and control these effects.
Q & A
  • What are the challenges of creating realistic glass materials in Eevee compared to Cycles?

    -Creating glass in Eevee is challenging because it lacks the sophisticated ray-tracing features of Cycles, which results in less realistic light bouncing effects. This can lead to faked appearances and weird results with the default glass BSDF in Eevee.

  • What is the issue with the default glass BSDF in Eevee when it comes to object distortion?

    -The default glass BSDF in Eevee distorts objects too much because it assumes the object is a complete solid, regardless of whether there are holes or spaces between different parts, leading to unrealistic refraction.

  • Why might the refraction depth setting in Eevee not work as expected?

    -The refraction depth setting in Eevee might not work as expected because it cannot be set differently per material, which is a limitation if you want different objects to have different thicknesses.

  • What is the alternative to using refraction depth for controlling the thickness of glass in Eevee?

    -An alternative to using refraction depth is to decrease the Index of Refraction (IOR) of the material, although this is not a realistic approach, it can be used for visual appeal outside the bounds of physical reality.

  • How does the custom glass shader in the video solve the issue of seeing refractive objects through other refractive objects in Eevee?

    -The custom glass shader allows for seeing some reflections coming through and maintains some refraction along the edges, which is not possible with the default glass BSDF in Eevee.

  • What are the settings required for transparent shadows to work correctly in Eevee?

    -To achieve transparent shadows in Eevee, the shadow mode must be set to 'Alpha Hash', and the blend mode should also be set to 'Alpha Hashed'. Additionally, increasing the number of samples in the render properties can help reduce noise in the shadows.

  • Why is backface culling turned off when working with glass materials in Eevee?

    -Backface culling should be turned off to ensure that all parts of the object, including those facing away, are visible, which is essential for capturing reflections and maintaining the integrity of the glass material.

  • What is the role of the denoise node in the compositor when dealing with noise in renders?

    -The denoise node in the compositor can help reduce noise in renders, especially when using 'Alpha Hashed' blend and shadow modes, which can introduce noise due to their transparency settings.

  • How does the custom glass shader in the video address the limitations of refraction in Eevee?

    -The custom glass shader combines both transparency and refraction methods to create a more realistic glass effect. It uses a mix shader to blend the results of these two methods, allowing for control over the appearance of the glass.

  • What is the purpose of the 'Edge Refraction' control in the custom glass shader?

    -The 'Edge Refraction' control adjusts the strength of refraction along the edges of the glass object, helping to avoid the 'double walled' effect and making the glass appear more realistic.

  • How does the custom glass shader handle the issue of caustics and absorption in glass materials?

    -The custom glass shader includes an absorption section that uses gradient textures and mapping nodes to simulate the absorption of light within the material, starting from the center and spreading out. This effect can be controlled and adjusted to suit different materials.

  • What are the benefits of using a mix of diffuse and translucent materials for the absorption effect in the custom glass shader?

    -Using a mix of diffuse and translucent materials for the absorption effect allows the shader to respond correctly to lighting changes, maintaining a realistic appearance under different lighting conditions.

  • How can the absorption effect be adjusted to start in a specific location within the object?

    -The absorption effect can be adjusted to start in a specific location by changing the texture space in the mesh data properties or by using nodes to shift the gradient textures to the desired location.

Outlines
00:00
🎨 Custom Glass Shader in Blender's Eevee

Jonathan Lampell from cgcookie.com introduces the challenges of creating realistic glass materials in Blender's Eevee render engine, which lacks the ray-tracing features of Cycles. He explains the limitations of the default glass BSDF, such as excessive distortion and the assumption of solid objects, which can distort the appearance of objects with holes or gaps. Lampell outlines the process of adjusting the index of refraction (IOR) and refraction depth to achieve a more realistic effect, while acknowledging the need to compromise on physical accuracy for visual appeal. He also discusses the inability to see through refractive objects in Eevee and introduces his custom shader designed to address these issues.

05:02
πŸ› οΈ Advanced Techniques for Creating Realistic Glass

The tutorial delves into advanced material settings required for the custom glass shader, including turning off backface culling to preserve reflections and using alpha hashed blend mode for better layering of transparent objects. Lampell recommends increasing render samples for noise reduction and introduces the denoise node in the compositor. He then explains the shader's inner workings, focusing on the use of transparency and refraction to create glass, employing a mix shader to combine these effects and the addition of Fresnel for a more natural appearance. The summary also touches on the limitations of refraction and the creative use of layer weight nodes to achieve a gradual transition.

10:02
🌟 Enhancing Glass with Dispersion and Edge Effects

Lampell discusses the addition of dispersion to the glass shader, inspired by a video from Grant Wilk, to create a more realistic chromatic effect. He describes the process of separating RGB colors and applying refraction shaders to each channel, then mixing them based on Fresnel for reflections. To avoid a 'double-walled' effect, he introduces a method to enhance the refraction at the edges of objects. The tutorial also covers the creation of transparent shadows by combining the results of transparent and refractive materials based on shadow rays, thus achieving a more convincing glass material.

15:03
πŸ–ŒοΈ Fine-Tuning Glass Material Controls

This section focuses on the fine-tuning of the glass shader's controls for user-friendliness. Lampell explains the various nodes and settings that allow artists to adjust the color, reflection tint, alpha hash color fix, reflection brightness, roughness, and inner refraction to achieve the desired look. He also introduces an edge refraction control that can be adjusted to prevent a double vision effect and discusses the use of absorption to simulate light penetration and scattering within the material, providing a more dynamic and realistic appearance.

20:04
πŸ’‘ Implementing Caustics and Absorption in Glass

The tutorial explores the implementation of caustics and absorption effects in the glass shader. Lampell credits other creators for their influence on his approach and suggests checking out their work for additional insights. He demonstrates how to create caustics using spotlights and adjusting their properties to project light through transparent shadows onto surfaces. The absorption effect is achieved by blending a mixture of diffuse and translucent materials based on a gradient texture that can be manipulated for different absorption patterns and colors, adding a layer of realism to the glass material.

25:06
πŸ” Adjusting Texture Space and Mesh Data for Custom Effects

Lampell addresses the issue of absorption effects appearing in the wrong location on an object by adjusting the texture space and mesh data properties. He explains how to change the gradient's center by manipulating the location along the x-axis and discusses alternative methods such as using nodes for more precise control. The summary also covers the process of combining various nodes to create a shader that respects light changes and can be adapted to different materials, concluding with the availability of the shader for download and further learning resources.

πŸ“š Conclusion and Additional Learning Resources

In the final paragraph, Lampell summarizes the glass shading techniques covered in the tutorial and invites viewers to download the custom glass shader node for immediate use. He also promotes his new course on cgcookie.com, which provides foundational knowledge on materials and shading in Blender, including a simplified glass shader build and an overview of shader nodes and settings for both Cycles and Eevee render engines. The paragraph concludes with an invitation to visit cgcookie.com for more learning opportunities.

Mindmap
Keywords
πŸ’‘Glass BSDF
Glass BSDF refers to the Bidirectional Scattering Distribution Function used in rendering to simulate the way light interacts with glass surfaces. In the video, the creator discusses the limitations of the default glass BSDF in Eevee, such as excessive distortion and the inability to see through refractive objects, and how to improve these issues with custom shaders.
πŸ’‘Eevee
Eevee is a real-time rendering engine in Blender that is known for its speed and ease of use. The script mentions that creating realistic glass in Eevee is challenging due to the lack of certain lighting effects compared to Cycles, and the video aims to address these challenges by explaining shader adjustments.
πŸ’‘IOR (Index of Refraction)
IOR stands for Index of Refraction, a measure of how much light is bent, or refracted, when entering a medium. The script discusses the need to adjust IOR values to reduce the unrealistic refraction in Eevee's default glass shader, although it notes that the creator opts for a thickness control instead for more intuitive results.
πŸ’‘Refraction Depth
Refraction Depth is a setting that controls the extent to which light bends through a material. The video script mentions the limitations of Eevee's inability to set different refraction depths per material, which affects the realism of glass objects with varying thicknesses.
πŸ’‘Shader
A shader is a program that runs on the GPU to calculate the color and appearance of surfaces in a 3D scene. The script describes creating a custom shader to achieve more realistic glass in Eevee, including how to build and understand the components that make up the shader.
πŸ’‘Transparent Shadows
Transparent Shadows refer to shadows that show through semi-transparent materials. The script notes that the default glass BSDF in Eevee does not produce transparent shadows, which is a feature the creator aims to include in the custom shader.
πŸ’‘Alpha Hashed
Alpha Hashed is a blend mode in Blender that is used for rendering semi-transparent materials. The script explains that using Alpha Hashed instead of Alpha Blend can help with the layering of objects, like stacked trays, to appear more correctly in the render.
πŸ’‘Screen Space Refraction
Screen Space Refraction is a rendering technique that simulates the bending of light as it passes through transparent materials. The script mentions enabling this feature both in the material settings and render properties to achieve the desired refractive effect in Eevee.
πŸ’‘Fresnel
Fresnel effect describes how the reflectance of a surface varies with the viewing angle. In the script, Fresnel is used in the custom glass shader to create a more gradual and natural transition between transparent and reflective areas of the glass.
πŸ’‘Layer Weight
Layer Weight is a concept used in the custom shader to control the sharpness of the transition between different shader effects. The script describes using a Layer Weight node to avoid a sharp cutoff in the glass shader and to create a more realistic appearance.
πŸ’‘Dispersion
Dispersion is the phenomenon where different colors of light refract by different amounts, leading to a separation of colors. The script discusses adding dispersion to the custom glass shader to simulate the effect seen in real glass, where light can split into its constituent colors.
πŸ’‘Caustics
Caustics refer to the pattern of light that is reflected and refracted by a transparent material onto a surface. The script mentions adding caustics to the example scene to enhance the realism of the glass material by simulating the way light bends and projects onto surfaces.
πŸ’‘Absorption
Absorption in the context of the video refers to the effect where light is gradually absorbed by a material as it penetrates deeper, resulting in a change of color or intensity. The script describes an absorption feature in the custom glass shader that simulates this effect, adding to the material's realism.
Highlights

Creating realistic glass in Eevee is challenging due to the lack of light ray effects seen in Cycles.

Eevee's default glass BSDF can result in unrealistic distortions, assuming objects are solid without considering their actual geometry.

Adjusting the Index of Refraction (IOR) or setting a refraction depth can help, but these methods have limitations in Eevee.

A custom shader can be created to achieve a more realistic glass appearance in Eevee.

The custom shader includes a mix of transparency and refraction to overcome Eevee's limitations.

Transparent shadows are not achievable with the default glass BSDF in Eevee, but the custom shader provides a solution.

Backface culling should be turned off to ensure reflections are visible on all parts of an object.

Blend mode should be set to 'Alpha Hashed' to avoid layering issues with overlapping objects.

Increasing the number of samples in render properties can reduce noise introduced by 'Alpha Hashed'.

Screen space refraction must be enabled both in material settings and render properties for the effect to work.

The custom shader uses a mix shader to combine transparency and refraction for a realistic glass effect.

Fresnel or layer weight nodes can be used to control the sharpness of the glass transition.

IOR control is omitted in the custom shader, opting for a thickness control instead for user-friendliness.

Dispersion can be added to the glass shader for a more advanced effect, as demonstrated in a linked video.

Caustics can be simulated in Eevee by strategically placing and adjusting spotlights.

Absorption can be added to the glass shader to create a more complex and realistic material.

The custom glass shader includes user-friendly controls for color, reflection tint, and roughness.

The tutorial provides a comprehensive breakdown of the custom glass shader's node setup and functionality.

The custom glass shader can be downloaded from CG Cookie or the Blender Market for easy implementation.

Transcripts
Rate This

5.0 / 5 (0 votes)

Thanks for rating: