PRB: Texture Transparency in Direct3D Immediate Mode

Last reviewed: September 5, 1997
Article ID: Q159648
3.00 WINDOWS kbprg kbprb

The information in this article applies to:

  • Microsoft DirectX 3 Software Development Kit, version 3.0 on the following platform: Win95

SYMPTOMS

One method for achieving transparency in textures for use in Direct3D Immediate Mode is to use DirectDraw's support for color keys. When calling IDirectDrawSurface2::SetColorKey() on a texture surface to specify a transparent color, the texture does not exhibit any transparent pixels.

CAUSE

The default values of the internal-state variables in the rendering engine for the rendering module are not set to enable alpha blending so the texture is drawn completely with no transparency.

RESOLUTION

Enable alpha blending by setting the D3DRENDERSTATE_BLENDENABLE render state to TRUE.

MORE INFORMATION

The D3DOP_STATERENDER opcode for the Direct3D execute buffer sets the value of internal-state variables in the rendering engine for the rendering module. The D3DRENDERSTATE_BLENDENABLE D3DRENDERSTATETYPE for this opcode should be set to TRUE to enable alpha blending. The default value is FALSE. Setting this value to TRUE will enable texture transparency.


KBCategory: kbprg kbprb
KBSubcategory: GdiDirect3D
Additional reference words: 3.0
Keywords : GdiDirect3D kbprb kbprg
Technology : kbDirectXSDK
Version : 3.00
Platform : WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 5, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.