|
setBlendingsetBlending( source, destination)Textures are drawn by blending the incoming (source) RGBA color values with the RGBA color values already in the frame buffer (destination)source: GameLogic.BL_ZERO
GameLogic.BL_ONE GameLogic.BL_SRC_COLOR GameLogic.BL_ONE_MINUS_SRC_COLOR GameLogic.BL_DST_COLOR GameLogic.BL_ONE_MINUS_DST_COLOR GameLogic.BL_SRC_ALPHA GameLogic.BL_ONE_MINUS_SRC_ALPHA GameLogic.BL_DST_ALPHA, GameLogic.BL_ONE_MINUS_DST_ALPHA GameLogic.BL_SRC_ALPHA_SATURATE destination: GameLogic.BL_ZERO
GameLogic.BL_ONE GameLogic.BL_SRC_COLOR GameLogic.BL_ONE_MINUS_SRC_COLOR GameLogic.BL_DST_COLOR GameLogic.BL_ONE_MINUS_DST_COLOR GameLogic.BL_SRC_ALPHA GameLogic.BL_ONE_MINUS_SRC_ALPHA GameLogic.BL_DST_ALPHA, GameLogic.BL_ONE_MINUS_DST_ALPHA GameLogic.BL_SRC_ALPHA_SATURATE Note:The code below uses a texture's alpha channel. The Alpha button on the Texture Face tab doesn't have to be enabled.Sample Code# get the currrent controllercontroller = GameLogic.getCurrentController()# get object that owns this controllerobj = controller.owner# There's only one meshmesh = obj.meshes[0]# And only one materialmat = mesh.materials[0]# Using Blender GLSL Materials or Blender Multitexture Materials?if hasattr(mat, "getMaterialIndex") == True:# set blending of pixels to use texture's alpha channelmat.setBlending(GameLogic.BL_SRC_ALPHA ,GameLogic.BL_ONE_MINUS_SRC_ALPHA
)
|