6
$\begingroup$

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

$\endgroup$
1
  • $\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$
    – TheLabCat
    Nov 10, 2020 at 1:57

2 Answers 2

6
$\begingroup$

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

$\endgroup$
6
  • 3
    $\begingroup$ Can you explain what the nodes are doing? $\endgroup$
    – no-can-do
    Nov 14, 2020 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, 2020 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, 2020 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, 2020 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, 2020 at 15:28
5
+50
$\begingroup$

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!

$\endgroup$
3
  • $\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, 2020 at 17:51
  • 2
    $\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$ Nov 11, 2020 at 19:05
  • 1
    $\begingroup$ Great job. Who cares about true realism when it looks this good :). $\endgroup$ Mar 29, 2021 at 13:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .