Using Opacity Mapping for the Fences
 
 
 

The fences are a bit of a special case, because the chain-link parts of them should be partially transparent. You accomplish this the way you did bump mapping: by the use of bitmaps.

Set up the lesson:

Select the fences:

  1. On the main toolbar, open the Named Selection Sets drop-down list, and choose the fence selection set.

    This step is mainly to show you what and where the fences are. There is the main fence around the compound and the smaller fence that encloses the utility containers.

    NoteIncidentally, the main fence includes two gates, left and right. Each gate can move along its own local X axis to open or close the compound.

Use a basic material for the fence supports:

Each fence component, including the gates, actually includes two objects: a “structure” component for the fence’s supportive piping, and a “wire” component for the actual chain link.

  1. In the Material Editor, drag a new Standard material node to the active View, double-click it, and name the material, FenceSupport.
  2. In the Blinn Basic Parameters rollout, click the Diffuse color swatch to display the Color Selector, and then assign the material a light gray color: Red = Green = Blue = 188.
  3. Click OK to close the Color Selector.
  4. Click the FenceSupport material node again to make it active.
  5. Press H to display the Select From Scene dialog. Highlight the structure objects for all the fences: Fence-Structure, Gate-left-structure, Gate-right-structure, and Fence-sml-Structure. Click OK to select these four objects.
  6. Click (Assign Material To Selection).

Use a texture map for the chain link:

The chain link itself uses a bitmap with a chain-link pattern.

Chain-link texture for the fence

  1. In the Material Editor, drag a new Standard material node to the active view, double-click it, and name the new material FenceChainLink.
  2. On the Shader Basic Parameters rollout, turn on 2-Sided.
  3. Drag a new Bitmap to the active View. On the file dialog, assign sitework.chainlink.jpg as the texture.
  4. Wire the new Bitmap node to the FenceChainLink material’s Diffuse Color component.
  5. Click the FenceChainLink material node again to make it active.
  6. Press H to display the Select From Scene dialog. Highlight the wire objects for all the fences: Fence-Wire, Gate-left-wire, Gate-right-wire, and Fence-sml-Wire. Click OK to select these four objects.
  7. Click (Assign Material To Selection) and then turn on (Show Map In Viewport).

    The fence texture appears in viewports as a gray pattern on a black background. It isn’t yet to scale, so you need to adjust it with UVW Map.

    NoteBecause the mapping isn’t yet right, some fence surfaces might appear gray even if you turned on 2-Sided. The UVW Map adjustments will fix this.
  8. With all four objects still selected, go to the Modify panel and apply a UVW Map modifier.
  9. Change the mapping projection type to Box, and then set Length = Width = Height = 0.5m.

    Now the mapping and the scale of the chain link are correct; but of course, the fences still appear to be solid objects.

Use the chain-link texture to create transparency and opacity:

Just as in bump mapping, where black areas of a map appear recessed and white areas appear prominent (with gray values having an intermediate effect), in opacity mapping, black areas appear transparent and white areas appear opaque (while gray values create some degree of translucency).

Because the chain-link map is already black-and-white, it should work effectively both as a texture and as an opacity map.

  1. In the active View, drag a second wire from the Bitmap node with the chain link pattern. This time, wire it to the FenceChainLink material’s Opacity component.

    Bitmap controlling both color and opacity

  2. Click the main FenceChainLink material node, then click to turn on (Show Map In Viewport).

    Now, in the viewport, the chain-link portions of the fence appear partially transparent.

    Viewport display of fence with opacity mapping

    The one thing missing from this view is transparency in the fence shadows. Depending on your graphics card, viewports might not display opacity mapping just as they don’t display bump mapping. If this is the case, you must render to see the effect of opacity mapping on shadows.

  3. Click (Render Production).

    In the rendering, the shadows convincingly match the transparency of the fence.

    Rendering of opacity-mapped fence

Save your work:

Next

Texturing the House: More Mapping Techniques