OpenGL Library for Delphi,
maintained by Eric Grange,
based on Mike Lischke's GLScene.

 

Articles - Using superblack transparency


Superblack transparency will turn black parts of a texture transparent. This can be useful in creating shapes with textures. For example a realistic tree can be created by using an image of a tree that has non tree parts black. For example:

image

When the texture is assigned to a GLScene object with superblack transparency turned on black parts are transparent:

image

To set a material to use superblack transparency set the TGLMaterial blending mode to bmTransparent and the TGLTexture imagealpha to tiaSuperblackTransparency and load the image. Also having TGLTexture texturemode as tmReplace seems to be necessary aswell. It is best to save the superblack transparent image in TGA format or BMP format since JPG format isn't lossless and you'll see an ugly black line around your texture if you save it in JPG format.

by skinhat
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by Wikka Wakka Wiki 1.1.6.2
Page was generated in 0.0279 seconds