Jump to content
  • Advertisement
Sign in to follow this  
modena

Artifacts when trying 2D scaling in D3D

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

I've been setting up a little 2D graphics library using DX9, and the ID3DXSprite interface. All is good except for the scaling. I'm loading my images from one big frameset, and when displaying a single frame at scale x:1 y:1 (the parameters to ID3DXSprite::Draw), everything looks fine. However, if I increase the scale of the image by 4 or 8, artifacts appear on the side. I know the image will look "fuzzy" because of how D3D smooths out scaled images. I think these little black lines are parts of the other frames, just when they're stretched they "bleed" into the current frame. Is there a D3D setting I can change to limit this, or another work around?

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
One fix is to have some space around each sprite that is totally transparent. The background color, even though it is transparent, should go with your sprites - black, maybe?

The reason is that as the GPU blends it may use part of the color value of a pixel in smoothing even though it has alpha of 0.

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!