Diffraction Mental Ray shader maya files



Diffraction can be used to add blurred refraction and chromatic aberration effects on existing shading networks. It renders the refraction effect "over" the connected input material, like a separate transparency layer.



- Visit Daniel Rind's site and download the shader from Stuff/Diffraction
- Download the Maya files. (The files may be included in the new diffraction release too.)



- Copy the MI file to the `maya5.0/mentalray/include` directory.
- Copy the DLL file to the `maya5.0/mentalray/lib` directory.
- Copy the AEDirtmapTemplate.mel file to a maya script directory.
(The list of the current script directories can be queried using the following mel command: getenv "MAYA_SCRIPT_PATH")

- Add the following lines after similar declarations in the maya.rayrc file:
(The rayrc file is in the Maya5.0/mentalray directory in Maya 5.0)

link "{MAYABASE}/lib/Diffraction.{DSO}"

mi "{MAYABASE}/include/Diffraction.mi"

These lines initialize the shader for Mental Ray. If they do not exist than the shader appears only in Maya but not in Mental Ray,
and it gives error messages in the output window like these:
API 0.0 error 301031: call to undeclared function "Diffraction"
API 0.0 error 301036: undefined shader "Diffraction1"


Diffraction appears in the HyperShade at the `Create mental ray Nodes/Miscellaneous` tab.
(If you don't have this tab than create an environmental variable called
MAYA_MRFM_SHOW_CUSTOM_SHADERS set it to 1 and restart Maya. It will enable the display of MR nodes.)

There is a sample scene included in the zip file that displays the Maya connections and different features of the shader.
Have a look at Daniel's site for the shader documentation.