Opal Material

not this material exactly,but maybe this could help


1 Like

Looks like @JanSOLO. Searchbox lists users too ftr.

I’ve also been wanting to know how to do opal materials for a while – I’ve managed an opal-like effect, but not an opal material. Here’s hoping!

1 Like

If I recall correctly, it was a side-topic development from a discussion on this big thread:

The underlying ideas for how the material was created are in there somewhere.

There was another related topic at the time, but I don’t recall the exact title of it.

what about this?

1 Like

Found this gem. Pun intended.

1 Like

Yep - I used just this approach a few years back - but I wasn’t really happy with it.

Yep I saw that one too - however the emission nodes in the material are putting me off it. Opal doesn’t emit light.

You can’t have real color change based on light direction in Cycles. In Eevee you can convert shader back to RGB, and if you either bake (for object UVs) or render out (for screen space window coords), you can use this as a color basis for a glossy shader. Similar to what I do here for fun.

But no, without a proper shader for it, there is no way to do it automatically.

Of course opal doesn’t emit light… Using the emission node you can get colors change and effects inside the material, way faster than using volumetrics and very suited for animations. The light and colors from inside the opal come from the emission node, otherwise you get dull shadows and nothing would react to the camera position.
It is not because the node is called “emission” that the intended and effectively resulting visual effect is light.

Yep I know - I have been quite heavily involved in threads about iridescence and opal materials in the past and understand the limitations of cycles.

The video I linked to seems on the face of it to be one of the best attempts I have seen, despite these limitations.

This seems like a really fun material to make. I did some research about how opals get their color, and it seems they get it from diffraction gratings with spheres of silica. I’m not sure if the effect from spheres is different from the sawtooth shape–a quick search didn’t seem to clarify that. It does seem to be slightly different from what I’ve seen. I’ll have to ask around.

The diffraction grating materials discussed a while ago could be a good starting point. I actually made a nodes version of the final OSL a while ago but never posted it. I think the glass shader and some subsurface scattering or translucency could maybe work well.

With some help, I was able to find a specific name to attribute to the effect in opals. It’s called volume diffraction grating. It seems like we might be able to implement the equations in Blender.

Meanwhile, I was playing around, and it seems the material in the first post uses subsurface scattering Fresnel-mixed with some glossy. The colors might come from another textured glossy added on top. Oh, and there might be the absorption equation modifying the color of the subsurface.

I’m not really happy with the result of the textures or colors, but I think the overall material comes pretty close. I’ll post the .blend file when I clean it up later.

they can have both, diffraction grating and thin film interference.and as third variation reflection from colored minerals or part of silver gold whatever is inculded.

the blueish opal has thin film like cracks in it around 150-300nm that gives that blue-greenish opal color.
mostly the gaps in the cracks are filled with water.(SiO2 main material with nH20 as thin film in the gaps)

i have made a test with a glass shader with thin film thickness 150-300nm based on raylength.math used for is Gottfried Hoffmanns beers law equation.no thickness map used.its based on object raylength.
i fracured the model before with cell fracture addon,otherwise we have no gaps in the object.

next step in shaderbuild would be to add particles into the volume, which can be small thin film planes and or mineral or silver ect reflections.there are endless combinations possible like in nature.

1 Like

I got around to cleaning up the nodes, and in the process, changed the material to look better.

Here’s the .blend: Opal.blend (3.0 MB)

I’m not done with this material, yet. I’m still in the process of trying to understand how to correctly implement the grating equations, but I think I’m close to a breakthrough.

1 Like

In this situation you don’t really need an exact diffraction grating… But you still need the outgoing vector for making things look ok. And thought forcing the output vector by specifically changing the normals is pretty noisy and slow, Cycles has an almost forgotten closure (only available in OSL mode) that can be used here: The phong_ramp!!

This closure, together with some simple parallax distortion (to fake the volumetric layers), might be enough to produce very convincing results.

here’s the script I use for quick effects:

#include <stdosl.h>

shader phong_ramp_bsdf(
    float Exponent = 1.0,
    normal Normal = N,
    output closure color BSDF = 0)
    color Color[8];
    Color[7] = color(0.0, 0.0, 0.0);
    Color[6] = color(0.0, 0.0, 0.0);
    Color[5] = color(0.0, 0.0, 1.0);
    Color[4] = color(0.0, 1.0, 1.0);
    Color[3] = color(0.0, 1.0, 0.0);
    Color[2] = color(1.0, 1.0, 0.0);
    Color[1] = color(1.0, 0.0, 0.0);
    Color[0] = color(0.0, 0.0, 0.0);

    BSDF = phong_ramp(Normal, Exponent, Color);

and with a normal glossy mix:


Yeah, after more research and playing around in Blender, I realized there was simply too much math to implement. My goal changed to implementing an untextured version of the diffraction grating material previously discussed, but that might also be too much (I’ll still test a version of it, though).

Your idea here seems really cool! And your mention of parallax distortion is very interesting.

Man, that’s awesome. Too bad there is no .blend to download, copying that node tree would take hours!

1 Like

That is an awesome material. Thank you for your generosity in sharing.

check this thread he has an Opal set up
might work for you

happy bl