Sign in to follow this  

[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=""]thread[/url].

I've got an [url=""]image[/url] and an [url=""]alpha mask[/url]. How can I use the alpha mask for that image?

I've tried using a [url=""]Texture Processor[/url] and set it as the [url=""]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?


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