Basic Refraction (transparency)

Link, Like, Share.

Generally speaking using transparent materials on their own are more than enough to create the illusion of transparency, that something can be seen though another object or surface. For more representative accuracy however, the way light tends to distort on passing through clear or semi-transparent materials should be taken into account. This can be done including a Refraction BSDF node.

Download: Refraction BSDF example file (c. 200 KB – *.blend, *.tga).

Basic Material

As refraction is a material property, for the effect to work correctly a material is required. If one is not available (select an object and) click the + New button in Material Properties to create and populate a new material instance. Switch to Shading Workspace [1] and drop in an Image Texture node, Add » Texture » Image Texture, link an image (+ New or Open where appropriate) before then connecting Color output (Image Texture) to Base Color input (Principled BSDF) [2].

Important: if the material to be refracted makes use of non-procedural or non-generated data, an external bitmap image for example, objects will need to be fully UV Unwrapped to ensure the resulting effect is correctly mapped and rendered to objects and the scene. Refraction will work without UV Unwrapping, UV Mapping or Image Texture input however.

Basic material in Shading Workspace
Setting up a basic material in Shading Workspace [1] and the Node Editor (bottom), a simple Image Texture node [2] with image is linked to the default Principled BSDF node, Color output to Base Color input.

Transparent Material

Although refraction introduces transparency to a material with its inclusion it is not generally used for this purpose (should not be used to provide transparency in of itself). In other words materials to be refracted should be set up as though for transparency, the simplest being an image with alpha channel. To do this, if the bitmap image loaded into the Image Texture node described above includes an Alpha Channel, after loading link the Alpha output of the Image Texture node to the Alpha input of Principle BSDF [3], then in Material Properties set the Blend Mode to Alpha Blend [4]. The material will immediately appear transparent in the 3D View (assuming Material Preview or Rendered mode is active).

Important: for Cycles materials Blend Mode is in Viewport Display rather than Settings.

Design note: transparency can be established a number of ways; using an image with included Alpha Channel, using Principled BSDF Alpha (Transparent BSDF), or a separate Opacity Map, that is then further dependent on whether Eevee or Cycles is being used.

Basic material Transparency before refraction
Although refraction introduces transparency to any material its associated with, for the effect to work correctly transparency will need to be set up properly. For simple transparency connect Alpha output to Alpha input [3] then set the Blend Mode in Material Properties [4].

Refraction BSDF

Once the basic material is set up refraction can be added. To do this, from the Add menu in the Node Editor select Shader then Refraction BSDFAdd » Shader » Refraction BSDF. Click to drop the node into the workspace. Next, click Add then Shader again, then Mix ShaderAdd » Shader » Mix Shader. Click to drop in place. These are the two nodes needed for basic refraction.

Adding a Refraction BSDF node
With the basic material in place refraction can be set up by adding in a Refraction BSDF [5] and Mix Shader [6] nodes to the tree…

To complete the material tree link the BSDF output from Refraction BSDF node [7] to a Shader input of Mix Shader [8], then Shader output from the Mix Shader to the Surface input of Material Output node. Finally connect the BSDF output from Principled BSDF [9] to the remaining Shader input on the Mix Shader.

Design note: how Refraction BSDF is linked within a tree that includes transparency depends on the type of transparency accommodated by the material, using a Transparent BSDF node for example might mean Principled BSDF and Transparent BSDF first being passed through a Mix Shader [8b] (per standard transparency) whose output in then plugged into another Mix Shader [8c] that includes Refraction BSDF as an input.

Linking node to complete the refraction material
An ‘extended’ node tree may be needed depending on how transparency is supported, if Transparent BSDF [8b] is present for example, Refraction BSDF may need to be passed through its own Mix Shader [8c] before final output.

Linking node to complete the refraction material
… which then need to be connected so that both Refraction BSDF [7] and Principled BSDF [9] link to the Mix Shader [8], which in turn is linked to Material Output [10].

Refraction in Eevee vs Cycles

How refraction is displayed or rendered depends a great deal on the Viewport Shading mode and Render Engine used. For example, once the material is set up as described above, if Material Preview [11] is set in either Eevee or Cycles, the material will exhibit a ‘reflective’ quality but little ‘refraction’ as might be expected.

Design note: when rendering with Cycles, especially real-time, display can be cleaned up in Render Properties [11] by enable Denoising [12] under the Settings subsection – depending on system graphics a number of options will be available; e.g. Automatic, OptiX, OpenImageDenouse.

Refraction and Denoise
When using Cycles engine, in Render Properties scene (real-time display) rendering can be cleaned enabling the Denoising setting.

Refraction and Material Preview
In Material Preview for both Cycles and Eevee the resulting effect is displayed as having a reflective rather than refractive quality…

In Rendered mode however, there may be a marked difference between Eevee and Cycles that may also be affected by hardware capabilities.

Refraction in Eevee
Refraction in Cycles
In Material Preview for both Cycles and Eevee (top) the resulting effect is displayed as having a reflective rather than refractive quality. In Rendered mode (bottom) refraction tends to display marked differences between Eevee and Cycles, the latter being more accurate (relatively).

Link, Like, Share.