Jump to content

  • Log In with Google      Sign In   
  • Create Account


DirectXTK and PNG transparency


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Stuntdk   Members   -  Reputation: 424

Like
0Likes
Like

Posted 05 December 2012 - 02:20 PM

Hi,

I am trying out the Spritebatch function in DirectXTK, but I am having problems with transparency in .png images.
My code is based on a stripped down version of this example http://directxtk.cod...cussions/390346

The sprite png image is from Microsoft XNA Shooter example "player.png"

Any ideas how I can get transparency with DirectXTK?

Thanks!

Attached Thumbnails

  • SpriteBatch_Test.png


Sponsor:

#2 Stuntdk   Members   -  Reputation: 424

Like
0Likes
Like

Posted 06 December 2012 - 10:09 AM

I have found out why I had this problem, turns out that DirectXTK Spritebatch expects an image with pre-multiplied alpha.
The source images I had were not pre-multiplied.

Found a nice little application that could do the image translation easily http://www.qualibyte.com/pixelformer/

#3 MJP   Moderators   -  Reputation: 10243

Like
0Likes
Like

Posted 06 December 2012 - 03:43 PM

You can also just pass your own blend state to SpriteBatch::Begin if you don't want to use pre-multiplied alpha.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS