mrdoob/three.js — pull request #1161 by rhuitl (2012-01-21 22:19:46+00:00)
Title: Add texture-combining of an RGB(A) and a Luminance/RGB(A) texture

Add texture-combining of an RGB(A) and a Luminance/RGB(A) texture to MeshBasicMaterial.

Introduced new field "mapAlpha" that specifies a texture to use as the alpha channel.
Extended loadTexture() for custom texture formats, e.g. THREE.Luminance.

Usually, the alpha channel is embedded in the graphics used as texture. This patch allows setting a second texture "mapAlpha", and the basic shader has been extended to use the first channel from this texture as the alpha channel. As I use grayscale PNG images as mask, I extended the load image function to accept a format parameter.

Example:

```
zmesh = new THREE.Mesh( geom, new THREE.MeshBasicMaterial({
map: THREE.ImageUtils.loadTexture( "image.jpg" ),
mapAlpha: THREE.ImageUtils.loadTexture( "mask.png", {}, function(){}, THREE.LuminanceFormat ),
}));
```