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.


Parameters

Surface Material is an input color computed by an illumination shader and modified by the Glass shader.

Diffuse is the same color used by the illumination shader.

Reflectivity is the multiplier used to mix the input Surface Material color and the computed reflection.

Transparency is the multiplier used to mix the computed reflection and refraction.

Index Of Refraction is the refractive index of the glass.

Transparency Tint

Tinting is the coloration that glass gives light as it passes through its surface. Colors are filtered instead of mixed so that blacks stay black, and saturated colors remain saturated (although possibly filtered to a new hue).

Use Diffuse specifies that the Diffuse color should be used as the tint color.

Use Color specifies that the entire object should be tinted with 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.

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.

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.

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 Effect 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. For instance, if the index of refraction is set to 1, Fresnel will have no effect.

Custom Effect 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 Effect 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 Valuewhich does not vary over the surface of the object.

Scale allows the translucency to vary over the surface of the object by linking it to the transparency and scaling it by Scale Amount.

Lights contribute the illumination to the translucency effect.