earl 0 Posted March 10, 2003 I've noticed that sometimes my weapon optics, especially the crosshairs, get faint white outlines. Suchey also had some problems with the ghillie texture for his USMC sniper. I think I found the reason for it, so I wanted to share my solution and see if anybody else has more info about this. The beginning of the problem is when you get a white outline at the edge of your opaque areas. It only seems to happen when you have a clean transition from opaque to transparent. If it happens when you have a lot of border areas (like vegetation or ghillie textures) then you'll probably also run into 'brightening' problems as you get further away. This happens because of mip-mapping. As you get further away from an object, its textures will automatically be mipmapped, or downsampled to lower resolutions. When it gets down to just a handful of pixels across your whole model, those white border pixels take on an unfair importance, so your object might have 10 good pixels from your texture and 8 white pixels, making the overall appearance of your texture really light from a distance. A partial solution I found is to slightly blur the borders of your texture, so that the change from opaque to transparent is feathered. Here's a pic that sorta shows the problem: The top circle was a large pencil dot (perfectly black, no antialiasing around the edges) and the bottom one was the same, with 2 photoshop blur filters. The images are taken from TexView at various levels of mipmapping. I've seen more than a few weapon optics that have this problem (incl. my SR47's ACOG). I have a feeling that there are ways to either control the level of mipmapping, or directly edit an image's mipmaps. Or maybe we can specify that the alpha channel shouldn't get mipmapped? I don't know very much about this, but BIS seems to have avoided these problems in all of their work - can anybody suggest how? My trick for adding a slight blur doesn't totally solve the problem, and it's not always desireable to blur your texture, like with scope crosshairs. Share this post Link to post Share on other sites
Scorpio 0 Posted March 10, 2003 I used to have the same problem (and I sometimes still do). When I had a grey 'Marines' lettering, sometimes it would go reverse or have white outlines on it. The only way I could of stopped that was to skin the face again, or make the face again and then skin it. It normally has a mind of it's own in my case. Share this post Link to post Share on other sites
Skaircro 0 Posted March 10, 2003 I've found (using Paint Shop) a different background in the image makes a difference. Using a white backgound gave me white outlines at distance. But with dark background it wasnt noticeable. ie. (with black dot saved to alpha channel) - black dot on white background gives white outlines. black dot on near black background gives no noticeable outlines. Share this post Link to post Share on other sites
kegetys 2 Posted March 10, 2003 The outlines come from bilinear filtering, when the RGB channel has white colors (or any other) "outside" the visible area defined by the alpha channel. To fix it you need to have the RGB channel all black (or whatever color you use), including the areas hidden by transparency. Share this post Link to post Share on other sites
kegetys 2 Posted March 10, 2003 Heres some images of what causes it. The main reason is this RGB channel, which looks like this for example: When we add this alpha channel to the above RGB channel: ...The result looks like this (on a red/green background): That looks all fine, as you can see there is no white lines there, although theres white area in the RGB channel, but its hidden by the alpha channel. But, when we resize the image using bilinear filtering (thats what your 3D accelerator does to make the textures look "blurry") the result looks like this: As you can see, the cross now has a white outline because the way bilinear filtering works, it adds pixels to the very border of the resized image's cross by taking an average from the pixels next to it, which in this case means a black pixel, and a white pixel from outside the alpha channels area, this results in the border (which is actually grey). To fix this, the RGB channel above would need to be totally black so the bilinear sampling routine would come up with totally black pixels too. Share this post Link to post Share on other sites
earl 0 Posted March 10, 2003 Thanks for the info. My problem is that I'm working in Photoshop 7 - so my transparent areas have no RGB values at all (checkerboard pattern), and it doesn't actually show an alpha channel. I guess TexView assumes a white background for this, so I'll have to work with a different image format that uses an explicit alpha channel. Share this post Link to post Share on other sites
kegetys 2 Posted March 10, 2003 If you use the photoshop layer transparency for the alpha channel, photoshop will make up its own rgb data for the hidden areas. You need to use a "real" alpha channel instead (you can to add one from the channels window), plus for it to work with TGA's you need to download a fix for it from the adobe website. Share this post Link to post Share on other sites