Jump to content

View more

Image of the Day

Inventory ! Va falloir trouver une autre couleur pour le cadre D: #AzTroScreenshot #screenshotsaturday https://t.co/PvxhGL7cOH
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

DirectX sprite white edges

4: Adsense

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   

1419
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!

 



#2 Icebone1000   Members   

1955
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   Members   

2059
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   

1419
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.