HowToC:TransTextures
From S2PLOT
(Difference between revisions)
Revision as of 05:10, 23 November 2007 Dbarnes (Talk | contribs) ← Previous diff |
Revision as of 05:11, 23 November 2007 Dbarnes (Talk | contribs) (→How to make textures transparent) Next diff → |
||
Line 4: | Line 4: | ||
* load an image as a texture, | * load an image as a texture, | ||
- | * get access to the bitmap of the texture, | + | * get access to the bitmap of the texture, and |
- | * set the transparency of each pixel proportional to its brightness, | + | * make faint pixels in the texture transparent. |
- | * | + |
Revision as of 05:11, 23 November 2007
How to make textures transparent
It's very common to want to read a texture from an existing bitmap image. It's also pretty common to want to modify that texture so that parts of it are transparent. Here's an example bit of code that uses the S2PLOT texture functions to:
- load an image as a texture,
- get access to the bitmap of the texture, and
- make faint pixels in the texture transparent.