D3DXSprite
This is a sure way to achieve what you want. When loading in the texture, use the D3DX Utitlity function D3DXCreateTextureFromFileEx() and set the eleventh parameter to the colour you don''t want to be visible. It''s all in the documentation anyhows.
Also add the following:
device->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE );
device->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_SRCALPHA );
device->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA );
I assume it is not possible to load an "*.dds" file as a texture with the alpha blended transparency already removed?
device->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE );
device->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_SRCALPHA );
device->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA );
I assume it is not possible to load an "*.dds" file as a texture with the alpha blended transparency already removed?
If you''re truely using D3DXSprite look for the post I made a week ago (it''s on the 4th page of this forum right now - D3DXSprite Problems). I put in some good information about setting render/texture states that isn''t in the DX docs. If you don''t know where to set the states every sprite will automatically get filtered linearly, which can lead to halos around your sprites (because it combines the transparent and visible pixels around the edges of the visible part of the texture). Hope this helps.
Bill6
Bill6
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement