< Previous | Contents | Next >

Composite Materials

Building complex materials is as easy as connecting the output of a Material node to one of the Material inputs of another Material or Texture node. When a Material input is supplied just as with a 2D image, its RGBA values are used per pixel as a texture. This allows for very direct compositing of shaders.

For instance, if you want to combine an anisotropic highlight with a Blinn material, you can take the output of the Blinn, including its specular, and use it as the diffuse color of the Ward material. Or,

if you do not want the output of the Blinn to be relit by the Ward material, you can use the Channel Boolean material to add the Ward material’s anisotropic specular component to the Blinn material with a greater degree of control.


image

Combining an anisotropic highlight with a Blinn material using the Channel Boolean material


Reflections and Refractions

Environment maps can be applied with the Reflect material in the 3D > Material category. This node can be used to simulate reflections and refractions on an object. Reflections are direct-bounce light that hits an object, while refractions simulate the distortion of light seen through semi- translucent surfaces.

image

The reflections and refractions use an environment mapping technique to produce an approximation that balances realistic results with greater rendering performance. Environment maps assume an object’s environment is infinitely distant from the object and rendered into a cubic or spherical texture surrounding the object.

The Nodes > 3D > Texture > Cube Map and Sphere Map nodes can be used to help create environment maps, applying special processing and transforms to create the cubic or spherical coordinates needed.


image

Sphere map example

To produce reflections with real-time interactive feedback at a quality level appropriate for production environment maps, you make some trade-offs on functionality when compared with slower but physically accurate raytraced rendering. Environment-mapped reflections and refractions do not provide self-reflection or any other kind of interaction between different objects. In particular, this infinite distance assumption means that objects cannot interact with themselves (e.g., the reflections on the handle of a teapot will not show the body of the teapot). It also means that objects using the same cube map will not inter-reflect with each other. For example, two neighboring objects would not reflect each other. A separate cube map must be rendered for each object.

The Reflect node outputs a material that can be applied to an object directly, but the material does not contain an illumination model. As a result, objects textured directly by the Reflect node will not respond to lights in the scene. For this reason, the Reflect node is usually combined with the Blinn, Cook-Torrance, Phong, or Ward nodes.

Reflection

image

Reflection outputs a material making it possible to apply the reflection or refraction to other materials either before or after the lighting model with different effects.


image image


A Blinn material connected to a background material input of the Reflect This causes the reflection to be added to the Blinn output

A Reflect is connected to the Diffuse Color component of the Blinn, causing the reflection to be multiplied by the diffuse color and modulated by the lighting


Refraction

Refraction occurs only where there is transparency in the background material, which is generally controlled through the Opacity slider and/or the alpha channel of any material or texture used for the Background Material Texture input. The Reflect node provides the following material inputs:

Background Material: Defines both the opacity for refraction and the base color for reflection.

Reflection Color Material: The environment reflection.

Reflection Intensity Material: A multiplier for the reflection.

Refraction Tint Material: The environment refraction.

Bump Map Texture: Normal perturbing map for environment reflection/refraction vectors.


Working with reflection and refraction can be tricky. Here are some techniques to make it easier:

— Typically, use a small amount of reflection, between 0.1 and 0.3 strength. Higher values are used for surfaces like chrome.

— Bump maps can add detail to the reflections/refractions. Use the same bump map in the Illumination model shader that you combine with Reflect.