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:
- Continue from the previous lesson, or open army_compound02.max.
Select the fences:
- 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.
- In the Material Editor, drag a new Standard
material node to the active View, double-click it, and name the
material, FenceSupport.
- 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.
- Click OK to close the Color Selector.
- Click the FenceSupport material node
again to make it active.
- 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.
- 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.
- In the Material Editor, drag a new Standard
material node to the active view, double-click it, and name the
new material FenceChainLink.
- On the Shader Basic Parameters rollout,
turn on 2-Sided.
- Drag a new Bitmap to the active View.
On the file dialog, assign sitework.chainlink.jpg as
the texture.
- Wire the new Bitmap node to the FenceChainLink material’s
Diffuse Color component.
- Click the FenceChainLink material node
again to make it active.
- 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.
- 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.
- With all four objects still selected,
go to the Modify panel and apply a
UVW Map modifier.
- 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.
- 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.
- 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.
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.
- Click (Render Production).
In the rendering, the
shadows convincingly match the transparency of the fence.
Save your work:
- Save the scene as my_fieldhq_fencing.max.