From BlenderWiki

Jump to: navigation, search

How to use an Image Texture with partial transparency to make an Object partially transparent?

A maple leaf. Texture by "Gabio".

Many objects are too complicated to model or the modelling result would have to many vertices. Leaves are a prominent example (A maple leaf). The standard method to create such objects is to use an partially transparent image mapped to a plane.

We are talking here about material transparency, i.e. the object itself shall become transparent. There are several slightly different methods to achieve this, we will cover just two of them here.

If you want to see the shadow of the texture and not of the underlying object:

  1. you have to use raytracing shadows
  2. you have to turn on TraShadow for the shadow-receiving objects.

The Image

The basic image. Texture by "Gabio".

You need an image of the object. It is convenient if the image is square or has an integral proportion. Use a 2D graphic application to delete all parts of the image that shall become transparent. Save in a format that supports transparency like PNG or TGA (The basic image).

Back in Blender add a plane (Space->Add->Mesh->Plane). Scale it to the same ratio as your image (this is the reason why you should use an integral proportion for the image).

Switch to the Material Buttons (F5). Add a new Material. Add a new Texture. Switch to the Texture buttons (F6). From the drop down box in the Texture panel choose Texture Type Image.

Load the image from the Image panel. Switch Use Alpha on (Texture settings).

Texture settings.

Material Settings option 1

Back in the Material buttons locate the Map To panel. Set Alpha and Spec to negative (click twice on the buttons). Set DVar to 0 (Map To settings version 1.). Setting Spec also prevents specular highlights on the otherwise transparent parts of your object.

Map To settings version 1.

Material Settings option 2

Many people use the texture just the other way round, so we will show that way here also.

In the Material panel set the Alpha slider to 0, this will make the complete object transparent. Now we're going to make the textured parts visible again. In the Map To panel click Alpha once. Set DVar to 1. Don't set Spec (Material settings version 2). You have to take care of the specular highlights another way (e.g. with another texture).

Material settings version 2.
Two important settings
  1. Turn on ZTransp on in the Mirror Transp panel (pre-2.42) or in the Render Pipeline (2.42+).
  2. Turn on TraShadow in the Shaders Panel for any shadow-receiving objects. Otherwise the plane's shadow will show.

That's it. Add other textures for bump mapping or specular highlights, create a nice environment and use proper lighting.