2010/06/03

Gem Dispersion Shader Compound



One of the first things we can notice while watching Gems, is that they have high dispersive effect. Dispersion is due to the difference of Index of Refraction between colors, so there is a nice rainbow effect!

A friend tried to have this effect for a gem animation. It’s not so easy, because nothing in Autodesk Softimage let you do it. So, I’ve made this shader compound. It’s just RGB dispersion, with different IoR for R, G, and B. It’s not really fast, but it was enough for the need, and the animation was made!

Although there is no spectral rendering, it’s enough to have a cool visual effect. In fact, it is nice enough to be used in most case, when just the effect is needed, and not spectral accuracy.

As the result is interesting, I decided to release it as Educational Material. It is fully commented, ready to use and to be modified. Open the compound, and play with it!


Note about how to use Gem_Dispersion:
By default, the compound renders just the transparent part of material, without any reflection on surface.
If you want to have reflects, I strongly recommend you to make a new pass with ‘External Reflection Only’ override to ‘On’. Then, simply alpha blend this pass with the one with transp.
The ‘External Reflect Added’ is terribly slow, and I don’t recommend it. This need to be debugged…

If you make some pictures with this shader compound, please, don’t forget credits and send me your results. If you have any question about this compound, just send me an email!

Quick documentation:
Transp Color: The color of the Gem. It should stay not saturated. If you use too much saturated color, you would not see any dispersion effect.

IOR: Base Index of refraction of the Gem. Gems usually have strong IoR, between 1.8 to 2.42.

Dispersion: the variation of IoR between Red and Blue. The stronger this number, the stronger is the effect. I recommend to stay below 0.15.

External Reflection Only: when On, the output returns an alpha ready reflection on external surface of the gem. No transparence is rendering.

External reflection Added: Do complete rendering, with transparence and external reflection. Warning, it is very slow!

Metal Gem: when On, the reflection is colored by the Transp Color, giving a metallic look. This effect is not physical, and there is no metal gem in real world. Indeed, the effect is interesting.

You can download the compound here: Gem Dispersion Shader Compound

To see the animation made by David Mazeau with the help of the Gem Shader Compound: crystal-universe

And here are some pictures of some gems:






Gem Dispersion Shader Compound for Autodesk Softimage from François Gastaldo on Vimeo.

1 commentaire:

RoN43 a dit…

Thanks a lot!!!