Jump to content
  • Advertisement
Sign in to follow this  

Blend Modes - Writing Alpha to a texture

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

Hey everybody,

I'm trying to do a 2D Scorched Earth/Worms style game in XNA. Basically my game is doing per-pixel collision detection using a texture for the collision map.

The problem I'm having is I'm just trying to draw a circle to my ground texture to cut a hole in it and I'm at a loss.

I'm trying to do it the way worms did with a black and white texture for the ground (white is collidable, black is not) and then get fancy by drawing a white circle (with black key color) to it and use the blend modes to invert the white to make a hole in it.

This isn't working.

I've also tried changing the white circle color to alpha (still with a black key color) and then tried to write directly to the ground texture's alpha channel and overwrite it....and again, this didn't work.

I'm at a loss as to how to do this.

Any help GREATLY appreciated!

Share this post

Link to post
Share on other sites

can you visualize the texture you've written the collision info to?
texture a 2d quad with it...what's it look like?

here's something that got me a while ago; not sure if it's related but
when writing to textures, make sure you enable alpha.


the default is rgb, no alpha i think.

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.

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!