How to Simulate Glass Dispersion in Blender
Glass dispersion is the optical phenomenon where light separates into its individual spectral colors as it passes through a transparent medium. In 3D rendering, this effect adds a high level of physical realism, producing subtle rainbow fringing and chromatic aberration along the edges of glass and gemstones. This guide explains the physics behind the dispersion effect and provides a step-by-step workflow for building a dispersion-enabled glass shader using Blender's Cycles render engine and Shader Editor nodes.
What is Glass Dispersion?
Dispersion occurs because a material's Index of Refraction (IOR) is not constant for all wavelengths of light. When white light enters a refractive material—such as glass, water, or diamond—shorter wavelengths (violet and blue) bend more sharply than longer wavelengths (orange and red).
Standard 3D render engines typically calculate refraction using a single uniform IOR value across the entire visible spectrum. While this optimizes rendering performance, it ignores chromatic separation, causing glass objects to appear overly digital or sterile. Simulating dispersion requires calculating slightly different refraction angles for different color channels.
Simulating Dispersion Using Blender Nodes
Blender’s default Principled BSDF and
Glass BSDF nodes do not include a native dispersion slider
in Cycles. To replicate this effect, you can split the light path into
the primary red, green, and blue (RGB) color channels, assign a unique
IOR to each, and combine them using additive blending.
Step 1: Set Up the Base Nodes
- Open the Shader Editor with your glass object selected.
- Delete the default
Principled BSDFnode. - Add three
Glass BSDFnodes (Shift + A> Shader > Glass BSDF). - Add two
Add Shadernodes (Shift + A> Shader > Add Shader).
Step 2: Configure the Color Channels
Assign each Glass BSDF to represent a single pure
spectral band:
- Red Glass BSDF: Set the Color to pure Red (R: 1.0, G: 0.0, B: 0.0).
- Green Glass BSDF: Set the Color to pure Green (R: 0.0, G: 1.0, B: 0.0).
- Blue Glass BSDF: Set the Color to pure Blue (R: 0.0, G: 0.0, B: 1.0).
Set the Roughness on all three nodes to 0.0 (or match
them uniformly for frosted glass).
Step 3: Offset the Index of Refraction (IOR)
Base optical glass typically has an average IOR of around 1.52. Because red light bends the least and blue bends the most, offset the values accordingly:
- Red Glass IOR:
1.514 - Green Glass IOR:
1.520(Base IOR) - Blue Glass IOR:
1.528
For materials with high dispersion like diamonds, use a wider spread
(e.g., Red: 2.407, Green: 2.417, Blue:
2.435).
Step 4: Combine the Shaders
- Plug the Red
Glass BSDFinto the first input of the firstAdd Shader. - Plug the Green
Glass BSDFinto the second input of the firstAdd Shader. - Plug the output of the first
Add Shaderinto the top input of the secondAdd Shader. - Plug the Blue
Glass BSDFinto the remaining input of the secondAdd Shader. - Connect the output of the second
Add Shaderto the Surface input of theMaterial Outputnode.
Because pure Red (1,0,0) + pure Green (0,1,0) + pure Blue (0,0,1) equals pure White (1,1,1), the combined shader renders as clear glass across flat surfaces while displaying accurate spectral separation along curved and refracted edges.
Automating IOR with Math Nodes
To make the shader easier to control without manually typing three IOR values every time:
- Add a
Valuenode to serve as your Base IOR (e.g., 1.52). - Add a second
Valuenode to serve as your Dispersion Spread (e.g., 0.01). - Add a
Mathnode set to Subtract: connect Base IOR to the first socket and Dispersion Spread to the second socket. Plug this result into the RedGlass BSDFIOR. - Connect the Base IOR directly to the Green
Glass BSDFIOR. - Add a
Mathnode set to Add: connect Base IOR to the first socket and Dispersion Spread to the second socket. Plug this result into the BlueGlass BSDFIOR.
Group these nodes into a single Node Group (Ctrl + G) to
reuse the material with simple slider controls across different
projects.