Glass

The Glass shader accurately models the transparent and reflective properties of glass, including fresnel reflection and transparency shifts near the object's edges, coloration filtering of transparency rays (colored glass), colored shadows, blurring of transmissions and reflections, and more - all of which provides a simple way to obtain a fully realistic glass effect.


Procedure

In the Material dialogue box choose appropriate values for reflectivity, transparency, and index of refraction. Good default values are 1.0 for both the reflectivity and transparency, and 1.5 for the index of refraction.

Select the Glass shader as the material shader, and edit its parameters.


Parameters

Transparency Tint

Tinting is the coloration that glass gives light as it passes through its surface. It is a significantly different coloring technique than the diffuse coloring of SoftImage: colors are filtered instead of mixed so that blacks stay black, and saturated colors remain saturated (although possibly filtered to a new hue).

Solid Color specifies that the entire object should be tinted with the same color, which is set with the RGB sliders below.

From Diffuse specifies that the object's diffuse color (taken either from its material or from a texture map) should be used as the tint color.

Transparency and Reflectivity Blurring

The blurring functions can be used to blur rays as they pass through the glass (transparency blurring), or as they reflect off of the glass (reflectivity blurring). For example, together they might be used to simulate a glass with a slightly roughened surface - the transparency blurring would blur objects that are seen through the glass, while reflectivity blurring would blur the reflections seen on the surface of the glass itself.

The blurring is achieved by shooting multiple rays into a scene, each in a slightly different direction, and then combining the results. The number of extra rays determines the quality of the blur: using more rays gives a better blur, but also takes longer to render.

Samples controls how many extra rays are used. Generally, a larger value will improve the quality of the blur but will also take longer to render.

Spread controls the spread of the extra rays. A wider angle of spread gives a more blurred image, and narrower angle of spread gives a sharper image. A larger setting for the spread value will require a higher Samples setting to maintain quality.

Edge Transparency

Edge Transparency allows the artist to control how the transparency of the object changes according to the viewing angle. In the real world, glass objects become much less transparent as the viewing angle becomes greater.

None keeps the transparency constant across the entire surface of the object.

Fresnel accurately models how surfaces in the real world behave when viewed at steep angles (using the Fresnel equations from optics.) Be warned, Fresnel is extremely sensitive to the material's index of refraction, as set in the material dialogue box. For instance, if the index of refraction is set to 1, Fresnel will have no effect.

Custom allows the artist to control exactly how the transparency changes across the surface of the object. Middle sets the transparency of rays traveling through the center of the object, Edge sets the transparency of rays skimming the edge of the object, and Shift tells how values in between should be interpolated. Low values for Shift cause the Middle region to be wider and the edge region to be narrower, high values for shift cause the Middle region to be narrower and the edge region to be wider. (See the discussion on Custom Curves at the end of this chapter.)

Edge Shadow

Edge Shadow varies the shadows cast by the Glass object, causing the centers to be bright and the edges to be dark.

NOTE: Edge Shadow is not physically accurate; an accurate solution requires forward ray tracing techniques which are notoriously slow. Shadow Edge provides a quick, passable alternative.

None keeps the shadow brightness constant across the entire shadow; the brightness is determined by the transparency value set in the material dialogue box.

Custom allows the artist to control how the shadow brightness varies. Middle control the brightness at the middle of the shadow, Edge controls the brightness at the edges, and Shift controls how the values in between are interpolated (as above.)

Translucency

Translucency here works in exactly the same way as the Translucency shader. It allows a surface to be diffusely lit from behind, in the way that frosted glass is back-lit. The higher the translucency value, the more the back-lighting effects the surface. (For more information, see the Translucency shader.)

None disables Translucency.

Fixed sets the translucency to a fixed amount which does not vary over the surface of the object.

Scale Transparency allows the translucency to vary over the surface of the object by linking it to the transparency, which can be set by the material, a transparency map, or the Edge Transparency effect above.