Jump to content
  • Advertisement
Sign in to follow this  

XNA Content Processor Transparency

This topic is 2117 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 am having a strange issue with a custom content processor for processing map levels.


I have the following code which imports a PNG image. When I use the serialized data in the spriteBatch.Draw(..) call, the renderer does not see magenta as transparent and the magenta color is left on the screen:

var extRef = new ExternalReference<Texture2DContent>(path);
var texture = context.BuildAsset<Texture2DContent, Texture2DContent>(extRef, null, data, null, asset);

If I modify the code to use a TextureContent type along with the required importer and processor types, along with some casting on the game-code-side the transparency is fine and there is no magenta shown:

var extRef = new ExternalReference<TextureContent>(path);
var texture = context.BuildAsset<TextureContent, TextureContent>(extRef, "TextureProcessor", data, "TextureImporter", asset);

Could someone please shed some light on what is going on here?






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!