//****************************************************************************//
//
// Softimage XSI / Mental Ray Diffraction Shader
//
// by Daniel "thebigMuh" Rind
//
// Version 1.21, 02.11.2003
//
//****************************************************************************//

//*********//
// HISTORY //
//*********//

Version 1.21, 02.11.2003
 - Fixed a bug involving absorption. It would not get applied for total internal
   reflection, resulting in less absorption at steep angles as anticipated.
 - Updated the sample scene a bit.
Version 1.20, 12.05.2003
 - Fixed a bug involving exhaustion of the raytracing depth... At the same time
   added new feature involving exhaustion of the raytracing depth ;-)
 - Added "Normal Blend" option
 - Some very minor speed improvements (mostly not noticeable)
Version 1.10, 03.05.2003
 - Fixed a bug where no glossiness would get applied if the IOR was set to 1.0
 - Added thickness calculations. Take a look at the help file and the sample
   scene to see how it works.
Version 1.00, 23.04.2003
 - Initial release

//**************//
// WHAT THIS IS //
//**************//

The Diffraction node is a replacement for the standard XSI refraction_diffuse
node. It fixes the refraction bug, adds faster glossy effects, and the new
ability to model the different refractions of different wavelengths of light.

//**************//
// INSTALLATION //
//**************//

Please use the enclosed Diffraction.xsiaddon file to install the Diffraction
shader. Should something go wrong, you can still use the SPDL file.

//*******//
// USAGE //
//*******//

I hope you know how to get the Diffraction node into your render tree ;-).

As for the general usage, I have enclosed an example project (the extra file
"Diffractive_Glass.zip" in the samples subdirectory), that should show you the
correct usage of the node.

A relatively detailed description of what each parameter does is enclosed in the
"doc" subdirectory.

//************//
// THE SOURCE //
//************//

The complete C source to the shader is enclosed in the "source" subdirectory,
along with a VC 6 project. You are free to do with it whatever you want, but 
should you manage to produce something usefull/interesting/nice/cool with it, 
please be so kind and give me credit. Of course, if you find any "unintentional 
features", please e-mail me so I can fix it.

One of the files included (shadehlp.h) is a small .H file I started, which I am
going to fill with usefull helper functions for writing shaders. It will likely
grow over time, so you might want to put it in your %XSISDK_ROOT%\include
directory, and always replace it with the latest version.

//*********//
// CREDITS //
//*********//

I would like to thank all the people that posted new ideas and critics, or that 
sent me an e-mail telling me that they actually (will) find the shader usefull.

I would like to send special thanks to K-Effects Vienna for mental support and
pointing out the environment bug as well as supplying the Maya relevant scripts
in this release!

I am a 22 years old computer science student from Vienna/Austria. I love computer
graphics (which is the field I am studying in), I love XSI, and I love Mental 
Ray, so starting to program for it was only natural ;-).

If you want to contact me, you can do so at:

thebigMuh@chello.at

or by lurking for my presence on the XSI Base (www.xsibase.com) or the
3rd-Dimension (www.3rd-d.co.uk) internet boards. 

Eventually I might even update my homepage (www.animusartis.com).
