DGS stands for Diffuse, Glossy, Specular. DGS materials are used to simulate materials with physical accuracy. It's the combination of these DGS materials with Global Illumination that produce those 3D scenes of unprecedented photo-realism.
Global Illumination is a rendering tool designed to recreate the effect of reflected light. With Global Illumination, a single light can be used to illuminate a whole room. This is simply because light reflected by its surroundings continues to illuminate the scene.
The main benefit of using global illumination is that it produces a more predictable behavior of light. It accurately models the behavior of light by simulating indirect illumination. Photographers, for example, use the bouncing of light off reflector boards to increase a light's size - producing a softening effect. Diffuse light produced from this technique is perfect for reproducing human skin tone. Another benefit of Global Illumination is its ability to recreate color bleed. This is where the color from an object reflects or bleeds onto surrounding objects. This effect can add just that extra touch of realism to a scene.
To achieve the global illumination effect Photon Mapping is used. A Photon map is a data file used to store the global illumination solution. The visual effects of Photons are like individual paintball splats. When initially rendered, they leave their illuminating mark on the object and continue to travel as they bounce from object to object.
The aim here is to study the use of DGS materials with Global Illumination. The same model set-up is being used from the previous article and the rendered results will be used to compare conventional materials with DGS materials.
The main difference in the set-up is that a large cube is being used to recreate a room environment. This prevents photons from escaping into infinity - saving render time. Also, two point lights are included instead of spotlights, as they will convert to Mental Ray area lights more accurately.
Unlike conventional 3d shaders, such as a Lambert, Blinn, Phong or Anisotropic, a DGS Material simulates the natural behavior of light. Objects are seen by the human eye because the material properties of an object enable light to be reflected off its surface and into our eye. Some surfaces are rough and will cause light to reflect in different directions. This is known as diffuse light. In contrast are near perfectly smooth objects which reflect light at an equal angle of incidence. This is referred to as Specular light. Most surfaces exist somewhere between being rough and smooth. Those surfaces that have a slight sheen to them are known as glossy surfaces.
A DGS material has eight attributes: Diffuse, Glossy, Specular, Shiny, Shiny_u, Shiny_v, Transp, and Ior.
The Diffuse color is the base color of an object. The diffuse attribute controls how much of the light is reflected in all directions.
The glossy attribute controls light that is reflected in one direction, but slightly scattered. It is used to produce blurry reflections off surfaces that have a slight roughness.
The specular attribute controls how much light is reflected. It produces the characteristic hotspot or white shine seen on highly polished surfaces and also produces mirror like reflections.
As the DGS material is a physically accurate representation of a material, the Diffuse, Glossy and Specular attributes need to be set with accuracy in mind. For example, it is not possible to have a randomly rough, shiny object. Each Value of the HSV for Diffuse, Glossy and Specular can not exceed a combined value of 1. For example, a semi-glossy surface might have a Diffuse of 0.2, a Glossy value of 0.5, and a Specular value of 0.3 - giving the combined Value of 1.0. It is however possible to have a combined Value of less than one. As these attributes describe the reflection of light, smaller values simply mean that more light is being absorbed.
Shiny describes how blurry the specular reflects are and only affects materials set with a Glossy value. It works a little like the Cosine Power parameter of the Phong shader. The lower the Shiny value the glossier or more blurred the specular reflections will be. For example, higher values above 100 produce hard specular reflections and very low values of less than 1 make glossy reflection appear like a diffuse reflection.
Shiny_u & Shiny_v:
These control the amount of blurring along the U and V axis of a Glossy reflection. They are used to produce an anisotropic effect. Rough surfaces are usually made up of microscopic random bumps, producing a soft diffuse reflection. Anisotropic highlights however are produced form surfaces with microscopic bumps running along in an even grain. Reflections stretch in the direction of this grain, producing highlights that travel in one direction.
The Shiny_u and Shiny_v work just like the Shiny attribute where the lower the value, the larger the blur. When Shiny_u or Shiny_v is set to a value other than 0, Shiny is ignored. Anisotropic highlights are created by setting a value higher in either the U or V direction.
Transp controls how transparent the object is. If this is set to a value of 1.0, then the object effectively becomes air. As objects such as glass also reflect, this setting needs to be set to less than 1.0. For example, to create a glass surface, set Transp to 0.9, and set Specular to white. Or, for frosted glass, replace Specular with Glossy and set a value for Shiny.
Ior controls the Index of Refraction. It is used to create the effect of light passing through a medium denser than air. To see the effect of IoR the Transp needs to be set to a value higher than 0. The default of 1.0 produces no refraction and is equivalent to an object with a density equal to air. Some commonly used Index of Refraction values are: Vacuum = 1.0, Air = 1.0003, Water = 1.333, Glass = 1.5 to 1.7 and Diamond = 2.419.
All the objects in this scene will be assigned a DGS_material and a DGS_material_photon. The photon material will handle the indirect illumination created by the Global Illumination. Materials are assigned by selection the object, and in the Rendering Menu section, under Lighting/Shading, assigning a new dgs_material. A DGS material Shading Group is created, with the dgs_material linked to it. Scrolling to the Mental Ray section reveals the Custom Shaders section. The Material Shader field is linked to the new dgs_material and the material's attributes can be activated by selecting the input connection button. To assign the DGS_material_photon, scroll to the Custom Shaders section and select the add texture button next to the Photon Shader field. From the Photonic Materials group, choose DGS_material_photon. Ensure that both the photon material and material settings match. Finally, turning on Opaque in the Flag section will speed up render times.
The backdrop is a painted white wall. Acrylic based paint is usually a rough matte surface with most of the light reflected being diffuse. The backdrop material's Diffuse Value is therefore set to 0.8, with Hue and Saturation set to 0.0 as it is a white wall. Glossy and Specular are set to 0.0 as the wall is being used to scatter the light.
The ball, in contrast to the wall will be shiny. As a highly polished object, it will be used to study the effects of bouncing light. The ball will be a dark grey object with a Diffuse Value of 0.2 (with Hue & Saturation set to 0.0). To give the ball slightly softened highlights, Glossy is set to 1.0. The rest of the reflections will come from the Specular with a setting of 0.7. Shiny is left at 50, just to blur the highlights a little.
Negative Fill and Room Environment:
The black reflector boards (or negative fill) and the Room Environment are to absorb most of the light. In this set-up the Negative Fill is being used to shield the sphere from any direct illumination. Diffuse is reduced to 0.1, and Glossy and Specular are set to 0. Some light is reflected so that a Photon Map can be generated and we avoid the annoying "no photons stored after emitting 10000 photons" warning. This warning results when photons travel into infinite space, or are completely absorbed by a material and their reflection is not caught at least once.
Reflector Board - Positive Fill:
The reflector board is being used to catch the bouncing light and used to illuminate the sphere like a large soft light. Its Diffuse is set to a Value of 0.8 and Glossy and Specular are set to 0.0.
Light Shader and Physical Lights
As well as 3d objects, Mental Ray can also apply shaders to lights and cameras. A Physical Light can be applied to a point light, as a shader, and used to simulate the real world light property of decay. Physical Lights use a natural inverse-square fall off. Fall off is the rate at which light decays. A light's intensity diminishes by a factor of four each time it doubles its distance. An object that is twice as far away from a light source will be four times less bright than an object positioned half way. In other words, an object's brightness or illumination will be affect by how close or far it is to the light source.
The main value to control of a Physical light is its Color. The light's intensity is defined by the Value attribute of its HSV color. By default Maya automatically assigns a Value of 1000. Since the Physical light uses an inverse-square fall off, the RGB values are never in the range of 0-1 and need to be high enough for the light to travel.