White Outlining in Textures
Hi, I'm using a color key on an image of a button. Every time I display the image on screeen, which I make stretch a little bit in my game, there is a mysterious white outline around the image. I know I've seen this topic here before, but I have failed to locate it. Anyone know what causes this or how to fix it?
I was having a problem a couple of days ago with ID3DXSprite doing a fuzzy gray border around my sprites. I got rid of it by putting
immediately after my call to ID3DXSprite::Begin();
d3dDevice->SetSamplerState(0,D3DSAMP_MAGFILTER,D3DTEXF_POINT);d3dDevice->SetSamplerState(0,D3DSAMP_MINFILTER,D3DTEXF_POINT);
immediately after my call to ID3DXSprite::Begin();
Let me guess, the background you're removing is white? Chances are you've got your linear filtering picking up small amounts of white and blending it with your edge texels.
Usually sorting out the texture coordinates (see the "Directly Mapping Texels to Pixels" page) solves this problem. Dropping back to POINT filtering as was suggested will technically work, but you'll get very poor quality rendering once you start resizing the image.
hth
Jack
Usually sorting out the texture coordinates (see the "Directly Mapping Texels to Pixels" page) solves this problem. Dropping back to POINT filtering as was suggested will technically work, but you'll get very poor quality rendering once you start resizing the image.
hth
Jack
Quote:Original post by Cantos
I was having a problem a couple of days ago with ID3DXSprite doing a fuzzy gray border around my sprites. I got rid of it by putting
*** Source Snippet Removed ***
immediately after my call to ID3DXSprite::Begin();
Didn't work.
Quote:Original post by jollyjeffers
Let me guess, the background you're removing is white? Chances are you've got your linear filtering picking up small amounts of white and blending it with your edge texels.
Usually sorting out the texture coordinates (see the "Directly Mapping Texels to Pixels" page) solves this problem. Dropping back to POINT filtering as was suggested will technically work, but you'll get very poor quality rendering once you start resizing the image.
No, the background is actually another texture which is mostly dark blue and black. The texel thing sound like the way to go, but do you mean by 'sort' them? I'll take a look at that page you suggested now. Also, I've been looking at the SetSamplerState function and noticed that Anisotropic is a choice. In most games this can be set to a multiple of x2 if desired. Does this mean that the textures are rendered in that many passes, or does it mean something else entirely?
[Edited by - orphankill on November 23, 2007 10:23:34 AM]
Quote:The texel thing sound like the way to go, but do you mean by 'sort' them?Nothing to do with actual sorting, just to fix them [smile]
Quote:I've been looking at the SetSamplerState function and noticed that Anisotropic is a choice. In most games this can be set to a multiple of x2 if desired. Does this mean that the textures are rendered in that many passes, or does it mean something else entirely?Anisotropic filtering is essentially just an improvement over bilinear/trilinear filtering - try it and see, but it's more for oblique angles rather than the general case.
hth
Jack
Still haven't fixed the border problem, but...
I've noticed that the SetSamplerState function allows for bilinear filtering and anisotropic. But how would I set trilinear filtering, or adjust the anisotropic ratio level to 4:1 (or 8:1, etc, etc)?
Quote:Original post by jollyjeffers
Anisotropic filtering is essentially just an improvement over bilinear/trilinear filtering - try it and see, but it's more for oblique angles rather than the general case.
I've noticed that the SetSamplerState function allows for bilinear filtering and anisotropic. But how would I set trilinear filtering, or adjust the anisotropic ratio level to 4:1 (or 8:1, etc, etc)?
You need to set D3DSAMP_MIPFILTER to be D3DTEXF_LINEAR for trilinear - it's just linear filtering between mip levels. Normal bilinear filtering just takes the best mip level rather than a potential blend of two.
hth
Jack
hth
Jack
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement