A complex approach - Iridescence in cycles

After looking again to my previous node setup, and making experiments with CDs (which have a known slit distance of 1600nm), I’ve found some errors in the math i’ve use. So for those of you who have downloaded the file from post#33, you can now replace it with this new one Diffraction_Nodes.blend (716 KB).
There are a lot of changes, but the main one is the VectorRotation node that was previously based in Quaternion multiplications, and i’ve simplified it alot to make it faster.

So how to use this nodes…
First we must understand what diffraction really is.
when Light hits a surface that has a grating, each slit will bounce the light in a circular pattern, that will interfere with the bounced light from all the other slits, and the result is that each wavelenght will only be visible from angles that have the following characteristics: Distance * sin(LightAngle) - Distance * sin(CameraAngle) = Multiple of the Wavelength.
This produces the following effect:


where the order number are the multiples of each wavelenght. The zero order corresponds to a regular reflection, and all the wavelengths are reflected in the same direction [sin(LightAngle)=-sin(CameraAngle)].

In the image above, the grating distance is 2000nm. Smaller values make the order separation wider, and bigger values make the orders closer to each other. (producing more visible orders!)

In my approach, I used the same formula, but instead trying to find where the light goes to, I’m more interested in finding where the light can come from. With a bit of algebra, we get that for a specific wavelength and CameraAngle, the light angle must be one of the following possibilities:

(continues)

2 Likes