PRB: Texture Transparency in Direct3D Immediate Mode |
Q159648
The information in this article applies to:
- Microsoft DirectX Software Development Kit, version 3.0
- Microsoft Windows 2000 Advanced Server
- Microsoft Windows 2000 Server
- Microsoft Windows 2000 Professional
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.
STATUS
This behavior is by design.
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.
REFERENCES
For more information about DirectX and Direct3D, see the DirectX topic in the Platform SDK. This is available on MSDN and online at
http://msdn.microsoft.com/library/default.asp?URL=/library/psdk/directx/dxstart_1x2d.htm
Additional query words: 3.0
Keywords : KbDirectX300 kbSDKWin32
Issue type : kbprb
Technology : kbwin2000AdvServ kbwin2000AdvServSearch kbwin2000Serv kbwin2000ServSearch kbwin2000Search kbwin2000ProSearch kbwin2000Pro kbSDKDirectXsearch kbAudDeveloper kbWinAdvServSearch kbSDKDirectX300
Last Reviewed: June 26, 2001 |