DirectX sprite white edges

Started by
2 comments, last by george7378 11 years, 1 month ago

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!

Advertisement

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.

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

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]

This topic is closed to new replies.

Advertisement