# How to simulate glass dispersion with only one Principled BSDF node

Searching on the internet, I realized that Blender does not calculate the dispersion of the glass, in any case I have found a compromise, which is not precise, but let's say it does the "Dirty trick"

Personally, I'm taking a different way, and I like to create materials, always as much as possible without mixing "Shader" type nodes. In most cases, I can get all my materials, with the help of the Principled BSDF node, always connected directly to the Output node. In short, I like to work before the BSDF Principled node.

I was wondering if it was possible to do this trick using some math, or something similar linked to just one Principled BSDF, with no other shader nodes.

• This looks brilliant. I had just been thinking about such and thought there was no hope. I would try something with one or two color ramp nodes and the frensel node. Maybe use map range as well. Nov 10 '20 at 1:57

Made this (mostly) physically-based dispersion shader as a modification to a dithered dispersion shader @ParallelMayhem made. This method (first) is more realistic and has an infinite level of detail rather than the 3 levels of detail with traditional rgb method (second)

In these days it is an active thread (contributed also by @ParallelMayhem). Yesterday extended about some kind of caustics.

If I spoted it right - Shader works for Cycles only (@ParallelMayhem version is not physically based but works for Eevee as well).

• Can you explain what the nodes are doing? Nov 14 '20 at 21:56
• Mainly uses a noise to sample the light spectrum (upper part, see docs.blender.org/manual/fr/dev/render/shader_nodes/converter/…) and IOR around 1.45 which is glass (bottom part). The scale is to lighten the result... please try to explain a bit. But +1 Nov 15 '20 at 10:01
• @lemon - that is part I understood (Wavelent, Noise and IOR), but I don't know what to say about that math and its combination for result, so feel free to attempt or write new answer I will delete this. I just wanted noted here Gabe's version, I'm not the right person to explain it, sorry :) Nov 15 '20 at 15:17
• For an answer, that's what I have so far and even don't know if it is valuable or not, so... i.stack.imgur.com/U9Zoi.jpg Nov 15 '20 at 15:28

Interesting question. I think it'd be near impossible to do this as accurately as mixing glass nodes, but if absolute realism isn't your aim then of course your options open up.

Using a procedural texture at very small scale I was able to get this effect in cycles:

Although this is definitely not an accurate way of doing it, it does appear to be somewhat realistic and quite beautiful provided you have some good lighting. (Psst... HDRI)

The values in the colour ramp I did using the HSV mode and just changing the H value. The Hex values are: Black: #000000, Red: #FF0000, Green: #01FF00, Blue: #0001FF, and Black: #000000.

Let me know if there is something missing and I'll edit this response to include it.

Hope this helps!

• Very interesting, I was trying to use the 3 fresnel node to mix the separate RGB, but with no success. I believe it can be done (I hoped). But it seems very complicated to my brain. Nov 11 '20 at 17:51
• The problem is is that although Fresnel has an IOR value, it can't really be used for glass. I very much doubt it would be possible whilst using a usable amount of nodes. This is probably your best shot imo. Nov 11 '20 at 19:05
• Great job. Who cares about true realism when it looks this good :). Mar 29 '21 at 13:33