Sign in to follow this  
farooqaaa

[XNA] How to use Alpha Mask

Recommended Posts

[b]P.S: [/b]I am working on a 2d point and click adventure game. See my other [url="http://www.gamedev.net/topic/606271-xna-2d-point-and-click-games-how-do-they-work/page__p__4835201#entry4835201"]thread[/url].

I've got an [url="http://i.imgur.com/UZ0eZ.jpg"]image[/url] and an [url="http://i.imgur.com/vfD3n.png"]alpha mask[/url]. How can I use the alpha mask for that image?

I've tried using a [url="http://pastebin.com/q5y5Ut6w"]Texture Processor[/url] and set it as the [url="http://i.imgur.com/hm9NM.png"]Content Processor[/url] for the original image and it works great.

But now I can't draw the full image. It will always use the alpha mask.

Also, is the best way to accomplish this?

BTW, someone suggested me to use a [i]Depth buffer[/i]. How do they work?

Thanks

Share this post


Link to post
Share on other sites
Are you using pixel shaders? In a pixel shader you would pass both textures in and use the mask texture to determin the color of the pixel selected from your base image. You could add a variable to be passed in that would determin if you want to mask or not. This way you could have it both ways.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this