Change Cauchy Spectrum colours?

I am trying to create gem “fire” lighting, but would like to have the Cauchy Spectrum node be more in a specific colour range.

So if I was doing a blue colour, the fire would be more pink, blue & purple. Not as much red & yellows. Is this possible? I have been just changing the Cauchy-C as I believe the B is just Index of Refraction, correct?

How does one create a Spectrum file that can be imported through the “Spectrum from file” option?

Thanks

The Cauchy spectrum node generates an index of refraction that changes based on the wavelength: https://en.wikipedia.org/wiki/Cauchy's_equation

For materials like glass, or gems, using a fixed index of refraction, like for example 1.5, independent on the wavelength, is non sufficient to simulate some effects such as dispersion. The Cauchy spectrum node generates an index of refraction that varies based on the wavelength according to the above Cauchy Equation, producing much more realistic results.

To change the color of the gem, the best way is to adjust the absorption of the dielectric medium. As light travels inside the gem, light is absorbed depending on this absorption parameter. So if you set the absorption parameter to blue, all the blue frequency of light will be absorbed, and the gem will look yellow, because none of the red and green frequencies will be absorbed. If you set the absorption parameter to black, the gem will look white, because none of the frequencies will be absorbed. Please also note that the absorption parameter is on dependent on the size of the gem, because the longer the distance the light travels inside the gem, the more light will be absorbed. For this reason, you might want to adjust the scale of the color parameter to values much bigger than one.

For the spectrum files, please refer to the reference in Help->View Help and look for the “Spectrum(spd)” files reference. There is a explanation with examples on how to create spd spectrum files. You can use the nodes created in this way as input for the absorption parameter of the dielectric medium. If you use measured data from real life crystals you will get very realistic results. You can find online the tabulated data for many common crystals, for example here: http://minerals.gps.caltech.edu/FILES/Visible/Index.html

Thanks Nicola, i was reading the Wikipedia reference and I understand the Cauchy Equation.

I was playing with the various parameters yesterday. I use a lot of Swarovski crystals and some of these have “effects” painted on a clear crystal. So I am trying to replicate some of these effects, that is why the the question …

I will give that a try.

Thanks for the link. I did do a reference file of gems and there IOR. I will check this out.

A presto,

Randy

Do we make this file in a simple text-editor like Notepad on Windows?

I tried on the Mac, but I cannot import the SPD file.

Do I just need the numbers or all the information in the Help file example?

#amethyst.spd - Absorption spectrum of a yellow amethyst gemstone
#format
format = wavelength-value
#wavelength-scale (to transform from nanometers to meters)
wavelength-scale = 1e-9
#wavelengths-values
380 0.248
400 0.168
420 0.113
440 0.098
460 0.101
480 0.117
500 0.138
520 0.154
540 0.16
560 0.155
580 0.142
600 0.126
620 0.109
640 0.092
660 0.079
680 0.067
700 0.057
720 0.05
740 0.045
760 0.041

Caio Nicola,

thought you may find this interesting, if you don’t know about it.

LiDAR pulse data new file format

A presto,

Randy

Ciao Randy,
Yes, you can just use a regular text editor.
In the .spd files, you forgot to put a “#” at in front of the lines that represent a comment. It should be:

#format
format = wavelength-value 

etc… or you can leave the comments out altogether. Please let me know if you can’t get the file to import. If you can’t, can you please include the .spd file here?

Thanks for the link!

Caio Nicola,

I just copied and pasted from the hHelp file.

here is my file. I had to zip, I cannot upload .spd or .txt files to this discourse.

Should I be doing this on Windows, or will it work on a Mac?

Thanks

amethyst.spd.zip (1.0 KB)

Ciao Randy,
The file was created as an .rtf file (see the rtf extension), while you should create a plain text file. rtf files are not good because they add extra characters (not visible in the editor) that prevents them from importing. You should use a plain text editor to create the files, such as nano, or sublime text (I highly suggest this one, it’s fantastic)

Caio Nicola,

I will do with Sublime text, I use this for web stuff. I also use Atom for Rhino + python, because of its integration as a Rhino for Mac python editor.

A presto
Randy.