Jump to content
  • Advertisement

Archived

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

BeanDog

Translucency

This topic is 6736 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

What is the best way to do translucency? I have some explosion bmps but I want to paste them so what''s behind shows through. Thanks again, Ben Dilts

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Try a combo of ChromaKeying and messing with the AlphaChannel... What API?

--SR

Share this post


Link to post
Share on other sites
I seriously have no idea what you just said. I''m a complete C++/DirectX newbie (like 3 weeks).

By the way, I''m using DXSDK7.0a, if that helps. Maybe a tiny sample code?

Share this post


Link to post
Share on other sites
Take a look at DirectDraw Tutorial 4 within the DX7SDK Help file. It covers basic colorkeying, which you can use to make pixels of a surface transparent. This could be used, for example, by making every other pixel transparent..Allowing you to fake a 50% translucency.

Unfortunately, DirectDraw has never supported real alpha-blending, which would give you an arbitrary degree of
translucency. There are plenty of ways of doing it yourself in software, but you have to be really careful or the results can be amazingly slow. There have been various postings over the net on how to do alphablending in software for DirectX, some of the ones I''ve seen do it with straight C/C++ code, some with MMX assembly, etc. Try doing a net search with one of the major search engines.

Another option is to use OpenGL or Direct3D to do your sprite drawing. I know it may sound odd, but if you don''t
mind forcing users of your software to have some amount of 3D hardware acceleration, you can get alpha-blending support within the API and have it be hardware accelerated.
There was a recent article posted to this site on how to set up D3D to do 2D operations.

Since you are using DX7, I''d suggest you also look at the D3DX utility library Microsoft included. Among other things it makes it even easier to slap up 2D images using the D3D API.

For OpenGL, read a recent post to this message board by Jonathan titled something like "OpenGL for 2D".

Share this post


Link to post
Share on other sites
check out this old post for info on doing software alpha-blending:

http://www.gamedev.net/community/forums/Topic.asp?topic_id=8117&forum_id=10&Topic_Title=&forum_title=DirectX%2FOpenGL%2FGlide%2FGenesis3D

hope it helps


_________________Gecko___
Gecko Design

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!