Sign in to follow this  
george7378

DirectX sprite white edges

Recommended Posts

george7378    1441

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:

 

[attachment=14312: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!

 

Share this post


Link to post
Share on other sites
Icebone1000    1958

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.

Share this post


Link to post
Share on other sites
george7378    1441

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:

 

[attachment=14317:lem 3d hud.jpg]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this