The Diffraction Shader Plugin provides artists with a specialised shader that can be used to create realistic diffraction effects like the rainbow reflections created by a CD.
About the Diffraction Shader
The shader computes the reflections from a metallic surface comprised of tiny bumps coated with a transparent layer. The amount of bending is modeled using the Index attribute on the shader. This is the index of refraction of the transparent layer and can accept values from 1.0 to 2.0. When Index is set to 1.0, no bending occurs. A typical value for plastic is roughly an Index value of 1.5.
The distribution of the bumps is assumed to be periodic in the U direction and random in the V direction. The size of each bump is given by the attributes Height, Width and Length. Width corresponds to the U direction while Length stands for the V direction. The sizes are in microns and are typically in the range [0.05-5] so that they interfere with the wavelengths of the incoming light which are in the range [0.38-0.78] microns. The fixed separation between the bumps in the U-direction is modeled by the attribute Separation.
You can switch between two types of bump using the Method attribute. The Highlight attribute controls the size of the principal highlight on the surface (or the principal "line" in the case of the compact disk). This attribute varies between 0 and 1. For Highlight=0 you have no highlight, while for Highlight=1 the highlight covers the entire surface. The shader becomes more computationally expensive when setting values of the Highlight parameter higher The remaining attributes have meanings similar to the ones in the anisotropic shader of MAYA.
The attributes are summarized in the following table
Parameter Name | Description | Range |
Color | Can be used to change the global colour of the surface | R, G, B |
Ambient | multiplies the ambient light | 0.0-1.0 |
Method | Shading method: either CD-like bumps or diffraction grating-like wedges. | two choices |
Index | Index of refraction of the plastic cover on top of the diffraction grating/CD | 1.0-2.0 |
Height | Height of each bump | 0.0-1.0 |
Width | Width of each bump (in the U-direction) | 0.0-10.0 |
Length | Length of each bump (in the V-direction) | 0.0-10.0 |
Separation | Separation between the bumps (in the U-direction) | 0.0-10.0 |
Highlight | Size of the main highlight | 0.0-1.0 |
Twist | Rotation angle of the (U,V,N) local coordinates | 0.0-1.0 |
Brightness | Multiplies the intensity coming off of the surface | 0.0-10.0 |
Glow | Can be used to make the shader glow | 0.0-10.0 |
Transparency | Transparency of the surface | R, G, B |
Reflectivity | Multiplies the reflected color below | 0.0-2.0 |
Reflected Color | Light coming from the mirror direction | R, G, B |
What is Diffraction ?
Diffraction effects exhibit the wave-like properties of visible light. In computer graphics the interaction of light with surfaces and volumes has traditionally been modeled using the "ray theory" of light propagation. The ray theory assumes that light travels in straight lines between surfaces and that the radiant power flows along the geometrical rays. This theory is fine for most computer graphics applications. In general, whenever the size of the surface detail is much larger than the wavelength of light (roughly 0.5 microns) the ray theory should be a very good approximation.
Diffraction
can be loosely defined as all light-effects that cannot be modeled according
to the "ray theory" of light. Instead, the "wave theory" must be considered.
For example, when an incident planar wave hits a "rough surface", the reflected
wave is a very complicated wave which in genral cannot be modeled by a
set of rays. Figure 1 illustrates this point.
Figure 1: Diffraction of Waves by a rough surface
An Example: the compact disk
Diffraction
effects can easily be observed by looking at a compact disk. By rotating
the disk one can observe many different colours appearing and disappearing.
The colours are a result of both the wave nature of light and the micro-structure
of the compact disc's surface. The surface of a compact disk is comprised
of tiny little "bumps" of size that is roughly 1.0x0.5x0.15 microns (10-6
meters). The size of the bumps is comparable to the wavelength of visible
light, 0.3-0.8 microns, hence diffraction effects occur. Figure 2 shows
a zoomed in picture of the micro-geomtry of a compact disk. Notice that
the separation between the tracks is constant while the distribution of
the bumps on each track is more random.Figure
2 : micro-geometry of the surface of a CD
The compact disk is not the only example of a surface that causes diffraction effects. The advent of the laser allows many different microstructures to be created very cheaply. In fact diffraction gratings are usd nowadays in wrapping paper, bumper stickers, etc... Diffraction effects have also been observed on certain insects, whose "skin" has a tiny periodic-like micro structure. With this shader you'll be able to create diffraction effects on many different objects.
Further Examples:
These are some examples of "diffraction gratings". The different patterns are obtained by texture mapping the "twist" angle in the plugin shader.
|
|
|