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.

enter image description here

enter image description here

  • $\begingroup$ 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. $\endgroup$ – ZargulTheWizard Nov 10 '20 at 1:57

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: enter image description here

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!

  • $\begingroup$ 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. $\endgroup$ – Noob Cat Nov 11 '20 at 17:51
  • 1
    $\begingroup$ 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. $\endgroup$ – ParallelMayhem Nov 11 '20 at 19:05

Link to Gabe's (@BettiniGabe) tweet

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)

enter image description here enter image description here

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).

  • 3
    $\begingroup$ Can you explain what the nodes are doing? $\endgroup$ – no-can-do Nov 14 '20 at 21:56
  • $\begingroup$ I cant add more info about the math behind so I just extended with info from tweet and comments, and asked author to provide full answer. $\endgroup$ – vklidu Nov 15 '20 at 9:47
  • 2
    $\begingroup$ 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 $\endgroup$ – lemon Nov 15 '20 at 10:01
  • $\begingroup$ @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 :) $\endgroup$ – vklidu Nov 15 '20 at 15:17
  • 3
    $\begingroup$ 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 $\endgroup$ – lemon Nov 15 '20 at 15:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.