Glass with Chromatic Dispersion

  • February 09, 2018
  • 1,966 Downloads
  • 58 Likes
  • Blender 2.7x
  • Render: Cycles
  • Creator: M3gad3rtH
  • License: CC-0
You must be logged in to download.

Description:

To recreate chromatic dispersion, before I had to settle on merging red, green, and blue glass nodes together with different IOR values. And it wasn't good.

This shader allows the refractive index to be dispersed over the entire colour spectrum. It is fairly low-noise, only needing 100 or so samples for a clear image.

If you do use this on any project, i'd be happy to know :)

Under the hood:

The shader uses a very small texture that acts as a random number generator with a range of 0 to 1. This is fed into the Hue input on a 'Combine HSV' node. This generates a transmission at a single point in the colour spectrum.

Simultaneously the same output from the random number generator is also fed into a colour ramp. This colour ramp contains the refractive index data. The wavelengths closest to red (0 and 1) are given a higher index, and wavelengths closest to violet (~0.8) are given a lower index.

Essentially, violet coloured transmissions will have a smaller IOR than a red transmission. And all the colours in-between are linearly interpolated accordingly.

Since the texture is so small. Most areas of the colour spectrum are transmitted within a pixel space. Cycles' rasteriser or anti-aliasing averages all the different transmitted colours together for each pixel (I think?).

It's not perfect. Overall there is a slight blue tint. I suspect the Vonori texture used as the random number generator may not have a completely linear distribution of values between 0.0 and 1.0. Also caustics are very noisy, and more than always average out to white (Yes, I failed to render the Pink Floyd album cover).

Comments:

  • maus10021 profile picture
    maus10021

    OMG, I'm speechless, it's so beautiful! Great job!

    Written May 17, 2018
  • hanbinsun profile picture
    hanbinsun

    thanks

    Written January 20, 2021
  • chacha profile picture
    chacha

    Thanks bro, this is awesome!

    Written April 26, 2021
  • CountQuadula profile picture
    CountQuadula

    Thank you for the videos explaining the how and why you connected the nodes.

    Written July 18, 2021
  • nyakangi profile picture
    nyakangi

    thanks it is awesome

    Written December 03, 2021
  • iamblindman profile picture
    iamblindman

    amazing

    Written April 14, 2022