]> Pileus Git - grits/commit
Use multi-texturing for alpha masking in tex.c
authorAndy Spencer <andy753421@gmail.com>
Mon, 30 Jan 2012 07:06:08 +0000 (07:06 +0000)
committerAndy Spencer <andy753421@gmail.com>
Mon, 30 Jan 2012 08:16:09 +0000 (08:16 +0000)
commitd933d7f51e20beb0ea3cc1d1bffb07af68828198
tree18d3cbb6bd840d8f78562b2fc62ad5b7577bbd75
parent474d8fa06cb68a91acdf81c89d3bfe6dd2d7ba68
Use multi-texturing for alpha masking in tex.c

Multi-texturing uses two textures for each fragment. The example uses
GL_TEXTURE0 as the regular texture color and a second texture as the
alpha mask. Since there are two textures they can have separate
filtering an wrapping parameters.

The color texture uses GL_MODULATE which combines it with the existing
color. The alpha mask uses GL_REPLACE which causes it to replace the
linearly filtered alpha mask from the color texture with a hard-edged
alpha mask that is clamped to transparent at the border.

This is similar to how drawing is done in NASA World Wind
examples/tex/tex.c