How to use transparency

written by Mete Ciragan, chUmbaLum sOft


This tutorial explains how to use transparent materials in MilkShape 3D and how the different transparency modes affect the rendering. You need MilkShape 3D 1.7.9 or higher and this tree texture, which is a 32-bit PNG image.

How to make a transparent material

There are two ways to create a transparent material. Load a 32-bit image like PNG, TGA, RGBA or DDS, or simply slide the transparency slider a bit to the left.

1. Create a new material and choose the tree.png as your first texture. Click the New button (1.) and then the NONE button (2.) and choose your tree.png. After that you can rename your material to "Tree". As you can see on the preview sphere, the material is transparent. This is because the tree.png is 32-bit and contains an alpha channel, which tells what pixels are transparent or opaque. If your texture has no alpha channel, you can use the transparency slider to adjust the transparency of the whole material.

2. In this sample, we will create a simple tree:

How to use the different transparency modes

There are 3 transparency modes available:

To choose between the modes, right-click in any viewport and open the sub-menu "Transparency":

In the Depth Buffered with Alpha Reference mode, all pixels, which have an alpha value above the specified alpha reference value, are rendered. The default is 0.5, but you can set the alpha reference value in that dialog:

Here are some samples with different alpha reference values: 0.1, 0.5, 0.9. As you can see, depending on the texture and on how much the alpha values on the edge of the leaves fade out, different alpha reference values are necessary.

If you want to see the differences between the transparency modes, just create a forest and rotate the 3d view around. To do so duplicate the tree, move it to another place, duplicate it, move it, etc ...

- Mete