Jump to content
  • Advertisement
Sign in to follow this  
fazerbox

How Add Edge Transparency to Texture?

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

Hi all,

I have a very simple question.

I have a Texture and I use ID3DXSprite.Draw() to draw it. I want apply transparency to texture but only at edge. I want to do that without changing source texture file, I mean I don't want modify texture including transparency edge. See image below.

In there a simple way to do that? How?

Is it possible use SetRenderState to do that, maybe using a second Texture Applied to first that has info about Edge Transparency?

Thanks in advance.
Max.

Share this post


Link to post
Share on other sites
Advertisement

Hi all,

I have a very simple question.

I have a Texture and I use ID3DXSprite.Draw() to draw it. I want apply transparency to texture but only at edge. I want to do that without changing source texture file, I mean I don't want modify texture including transparency edge. See image below.

In there a simple way to do that? How?

Is it possible use SetRenderState to do that, maybe using a second Texture Applied to first that has info about Edge Transparency?

Thanks in advance.
Max.



Transparency is a pain in the rear. You can get a somewhat type of transparency through Device>Renderstate SourceBlend and DesitnationBlend. Depending on what your looking to do, the rendering order (sorting back to front) will need to be taken into consideration.

if your just looking to render a texture that has part of the image cut out (no background) you can use SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE);

Just remember to turn it off when your not using it.

Hope this helps,

Dj

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!