Jump to content

  • Log In with Google      Sign In   
  • Create Account

DirectX sprite white edges


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
3 replies to this topic

#1 george7378   Members   -  Reputation: 1196

Like
0Likes
Like

Posted 17 March 2013 - 10:51 AM

Hi everyone,

 

I'm drawing some alpha blended sprites using D3DXSPRITE_ALPHABLEND, and I've noticed that the sprites show some artifacts around their edges, where the alpha blending takes place. You can see some on the green arrow effects in this image:

 

sprite_white.jpg

 

The edges of the arrow show some whiteness and there's a vertical white line at the tip.

 

Does anyone know why this might be happening?

 

Thanks!

 



Sponsor:

#2 Icebone1000   Members   -  Reputation: 1086

Like
4Likes
Like

Posted 17 March 2013 - 11:09 AM

Hi everyone,

 

I'm drawing some alpha blended sprites using D3DXSPRITE_ALPHABLEND, and I've noticed that the sprites show some artifacts around their edges, where the alpha blending takes place. You can see some on the green arrow effects in this image:

 

attachicon.gifsprite_white.jpg

 

The edges of the arrow show some whiteness and there's a vertical white line at the tip.

 

Does anyone know why this might be happening?

 

Thanks!

 

I guess linear filtering is taking the pixels from the other side of the sprite, since its on the edge. Id try making the sprite have the image not touching the edges, or change the filtering mode if its not a problem for you.



#3 Steve_Segreto   Crossbones+   -  Reputation: 1530

Like
1Likes
Like

Posted 17 March 2013 - 12:04 PM

George, IceBone1000 has given the right answer here. I agree with him.



#4 george7378   Members   -  Reputation: 1196

Like
1Likes
Like

Posted 17 March 2013 - 02:50 PM

It seems that he/she has! I loaded in the textures using D3DXCreateTextureFromFileEx() and specified D3DX_FILTER_NONE, and it looks much better. In fact, all my sprites do. This also has the added advantage that the textures aren't scaled to the nearest power of 2. Thanks for the help!

 

Just as a bit of a bonus, here are the sprites working nicely now:

 

lem 3d hud.jpg






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