Last week I released a diamond material. I got a few comments suggesting some changes, so I thought I would go back and tweak some things. So here it is: v2 of the diamond shader. Continue reading to see what I changed and download the shader.
Just a warning, this post is quite image heavy. 🙂 Again, I’ve uploaded the .blend file so you can tweak it.
Before I go into detail about the new shader here’s a comparison with the same lighting setup:
Here’s how the node group looks like now:
And inside the group:
Unlike the previous version (which had two shaders), I’ve added a dispersion amount, so you only need one shader. However, I kept the Volume Absorption the same. I’ve also added a couple different inputs including: Roughness, IOR, and Dispersion.
After doing some more research (and many formulas later), I resorted to master blendheads before me: the standard red, green, and blue combination. I tried using the wavelength node and some math combinations but the standard combination just works really well. Really, cycles should bend the different wavelengths for us, but that currently doesn’t happen (I would love for it to be implemented, hint, hint 🙂 ).
The shader now works by using three glass shaders to simulate the primary colors: red, green, and blue. The dispersion effect still works the same: the IOR is slightly different for each glass shader. Then I combined them with the add shader (which now adds exactly to white).
Now all you have to do to color the diamond is change the Color. When coloring the diamond I would use the HSV color control and not go above 0.200 saturation. Otherwise, the reflections get colored as well.
By setting the roughness higher, you can achieve some cool artistic results:
I’ve also added the ability to use a custom IOR, which makes it really easy to adapt it for other gemstones.
There is now a custom dispersion input which takes the base IOR and adds the amount onto the previous one (e.g. IOR of 1.000 and dispersion of 0.500 gives IOR values of 1.000, 1.500, and 2.000 respectively).
EDIT: here are the correct IORs for different colors passing through diamond: red 2.410, green 2.426, and blue 2.444.
Absorption works the same, although I darkened the default color. Again, I recommend not increasing the density past 50, otherwise the color becomes oversaturated. By combining the absorption in different ways you can create some really unique results.
I also did a top render to show how the dispersion looks from above:
Just to see how this shader works in other environments, I added an HDRI. (I’m using the apartment HDRI from the sIBL Starter Collection. You can download it here: http://www.hdrlabs.com/sibl/downloads/sIBL-Collection.zip)
I hope you enjoyed this shader, and feel free to give me feedback on it. You can download the shader here: Diamond Shader v2