Help with Blender Cycles Diffraction Shader

Hello

I tried making a diffraction-shader in Blender with an video for Cinema 4D:

But as I tried to do remake it, the reflections seem to be not colored.

1 group of nodes for one reflection, 2 group of nodes for colorful reflections.
When I shift the color of the normal of one BSDF node, one reflection should have seeable color.

Here’s also a blend file with the material:
Diffraction.blend (1.1 MB)

Examples for diffraction would be machined surfaces, holographic embossings,
screens, but also CD’s too.

So I hoped someone might know how to approach this
Thank you

You’re normals are not correct.
First, normals are Vectors so using a RGB node doesn’t do the trick.

Second, your normals are all the same for the RGB frequencies in each order… That makes the red, green and blue to be reflected in the same direction, producing a white reflection.

A better approach to the Vectors, is to use the Vector Rotate node, and you can rotate the Surface’s Normal with far more control.

For example, here’s an example of using the VectorRotate and the White Noise to get a better spectral range of the frequencies:

1 Like

Thank you!

So I tried remaking the nodes in the screenshot.
I also applied the Vector Rotate to my setup.

I didn’t get anywhere with my setup.
But the setup in the screenshot looks nice. I’m not sure how to apply that though.

The smooth shading does not work, I had this before with other shaders, I think that’s because of the normals input? Can something be done about that?
Also objects with that setup always have like a dark part with them.

Should I just mix it?
I made the colorramps black to gray for my screenshot.


(left mixed .5 shader, middle simple steel shader, right diffraction)

Also the Tangent node, it goes around in a circle inside out on one axis, I think.
This works as long as I don’t apply transforms on cylindrical objects for their round faces.
How do I apply this to the other faces and objects with other tangent that radial ones?
I’d have to make an normal map for that maybe?

Thanks for the help and quick response and sorry for asking so much

That’s a pretty neat approach to do radial anisotropic in Eevee.

1 Like

Here’s another example, this time with Order_0, Order_-1 and Order_1:

In the 3DView there’s a linear (using the uv_x) and a radial version (z).
The divergence of the ±1 orders is controled in the MapRange, with the start and end angles in radians.
And one could also replace the ColorRamp with a Wavelength node, but I think it’s much controllable this way (in artistics terms of course, as we’re not really using the correct math for the diffraction).
edit: One thing that wasn’t asked, but it’s relatively important, the distance of each slit in the grattings, affects the divergence angle; so a CD and a DVD reflect light in different ways.

It’s all just a matter of choosing your tangent vectors correctly (and this is a totally different subject). A tangent vector is any vector that’s parallel to the surface (perpendicular to the normal). For example, a CD has a radial grating pattern, many gratings you can find are linear, and holograms tend to be a rippled mess of gratings…

Or any kind of anisotropic… :slight_smile: But it’s not perfect, and still requires to max out Eevee samples and fine tuning the denoiser.

1 Like