How to Create a Fence in 3ds Max Using Transparency Maps

Creating props for a scene to be used inside a game engine can mean a completely different approach to how you actually go about creating the prop. Games require a tight polygon budget, pre-rendered scenes really don't. Of course, the more polygons you have in a scene means the longer the render time is going to be. If you're willing to wait, you're able to make the scene as complex as you like, and get as much detail in as you can. However, using some of the same techniques for game creation can also be utilized for pre-rendered scenes because it can save a significant amount of time as you'll find out in this written tutorial. You'll learn how to create a fence in 3ds Max using a transparency map (opacity or alpha map) in this article. One approach you could take for creating a type of prop like this is to model a single chain link, copy and paste it hundreds of times to create the entire span of the fence. Sure, this works, but it can take a lot of time, and you'll end up using hundreds of individual links which increase the polygon count in the scene massively. To create small details like this, a transparency map is often utilized to do the bulk of the work. Instead of having hundreds of tiny links modeled out in your scene, you just have a simple flat plane with a transparency map applied to it. This means less time spent modeling the links. This is a must when creating these types of intricate props for video games, however, for pre-rendered scenarios it's really up to you on how much detail you want. For this, there's just a very simple fence modeled out, which basically consists of a few cylinders. This is perfectly fine, your fence may be more intricate than this, but since we're focusing on the texturing aspect for the chain links it's going to be kept very simple. The first step is going to be creating the texture to be used as the transparency map. You can find some great free tileable textures for chain links online. For this tutorial we used the free PNG seamless chain link fence texture at psdgraphics.com. Bring your texture into a program like Photoshop, this is where you'll set up the transparency map for the chain link texture. Tex_01 With the texture opened you'll want to create a copy of the layer. The first layer will act as the diffuse material, and the second layer will actually act as the transparency map. To create a copy of the layer simply Alt+Left click and drag on the layer within the layer's panel. You should now have two instances of the same chain link texture. Tex_02 The new layer you just copied can be named something like "Chain Opacity", and the other layer can be named "Chain Diffuse." With the Chain Opacity layer selected choose the Magic Wand tool and select all the areas around the actual chain link. Tex_04 Now press the shortcut Shift+Ctrl+I. This will inverse the selection to now select just the chain link. Tex_05 You now want to fill the chain in with complete white. So press the shortcut Alt+Backspace. This will fill the selection with the foreground color which by default is white. Tex_06 Repeat the shortcut Shift+Ctrl+I to inverse the selection once again, and this will make it so just the background around the chain link is selected. Now press Ctrl+Backspace to fill the background color, which by default is black. The way this works is that the transparency map makes anything that is white completely opaque, and anything that is black will be completely transparent. So the chain links will show up in 3ds max, but anything in between the links will be transparent. Tex_07 Great! So now you have the diffuse layer, and the opacity layer created. You can save off the images to something like a JPEG if you like. Make sure you name them properly, for example the opacity layer should be named Fence_Alpha.jpg, and the diffuse layer should be Fence_Diffuse.jpg. Now that you have the texture created it's not time to put it all together, so open up your 3ds Max scene and bring up the material editor. Mat_01 Select one of the default materials and scroll down toward the button of the material until you see the Maps tab. Open the tab and check the Diffuse Color checkbox and select the "None" box to open up the Material Browser. Mat_02 Choose the Bitmap option and navigate to where you saved your diffuse texture. Once you've applied the texture to the diffuse map, select Go to Parent to navigate back to the material options. Mat_03 Scroll down again to the Maps tab and check the Opacity check box and select the "None" box to plug in a texture. You'll choose the Bitmap option again but this time load the alpha texture that you created. Mat_04 The last thing you'll need to do is select the Go to Parent option again and within the material options turn on 2-Sided. Finally you can create a simple flat plane and place it inside the fence poles. Mat_06 Now back into the material editor and select the chain link material and choose Assign Material to Selection and make sure you also have the Show Shaded Material in Viewport selected. As you can see from the image, it's not really looking like a fence yet, that's because we need to create a simple planar map to the fence. Mat_07 With your plane selected open up the Modifier List and scroll down to the very bottom until you find UVW Map Mat_09 Within the UVW Map option scroll down to where you see the U Tile and the V Tile. You'll want to bump up these values quite a bit to get the chain links to match the size of your fence. In this case the U and V values have both been set to 25. Depending on your scene, this will vary. Mat_10 Using transparency maps for situations like this can be a great way to save polygon count and speed up render time. A transparency map is a technique heavily utilized in game design but it can also be helpful for architectural visualizations and scenes where the camera is not going to be up close to the geometry. While this was just one simple example of where you can use a transparency map their are many other areas you can utilize a transparency map, like hair, plants, windows and cloth.