Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

SikCiv

Anyone worked out the D3DX sprite problem?

This topic is 6913 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ive scrapped my implementation of D3DX in my game because the sprites arent colorkeyed, resulting in whole rectangles to be blitted. But I lose the FAST alpha blending feature of 3D sprites ); Has anyone worked it out yet, or is it just not possible?

Share this post


Link to post
Share on other sites
Advertisement
Well, I''ve never really used colorkeying in 3D rendering (never found a place where it would do better than actual alpha blending), but here''s a list of the things it seems must be done in order for it to work:

- Create the texture surface with the DDSD_CKSRCBLT flag, making sure to set the ddckCKSrcBlt member of the surfacedesc structure.

- Set the D3DRENDERSTATE_COLORKEYENABLE render state.
and/or (not sure)
- Set the D3DRENDERSTATE_COLORKEYBLENDENABLE render state to true. Set D3DRENDERSTATE_ALPHABLENDENABLE to true. Set D3DRENDERSTATE_SRCBLEND to D3DBLEND_SRCALPHA. Set D3DRENDERSTATE_DESTBLEND to D3DBLT_INVSRCALPHA.

Well, mess around with all those different settings and you might get something working. Also, if you havn''t yet, you could try calling D3DXPrepareDeviceForSprite. That might help too. Hope this helps.

Share this post


Link to post
Share on other sites
I found something interesting that has to do with this. Some video cards do not support COLORKEYENABLE on 3d textures. In fact using an alpha bit for your textures is the best way to assure that the program will work with as many video cards as possible.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
It''s true. Our team here at college has made a space combat game using D3DX for sprite rendering. It took awhile but we managed to get colorkeying to work, however, once we started alpha testing with various hardware, it was interesting to find that some cards (namely TNT2) did not support colorkeyed textures. I am now looking into the alphabit method.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!