White Lines on alpha images

hey everyone,

having a strange problem w/a number of alpha textures in our game. Basically some (not all) have white edges when applied to polygons. We’re doing a game that is all based on an ortho camera and are building the environments out of “pieces” that can move or whatnot.

Anyways, I’m using simple quads for all the objects and when I apply my alpha images on some of them i get strange faint white lines on either edge (x side).

I’ve tried all the tricks → Turned off mipmapping, turned off resizing, set the texture to clamp, etc etc. Nothing seems to work.

Any help would be greatly appreciated!
Cheers
Bryan

Very common problem. Try a forum search and you should come up with many hits.

http://vimeo.com/8444889

Thanks for the quick reply Jessy… I see what the problem is now. Source art was in PNG… so it was causing this issue.

I’ve heard that you might be able to use Fireworks if you want to use .png, and you started off in Photoshop. That’s not a good workflow for me, but neither is Solidifying, really. Another option is to use a black background, and a different blending mode in your shader (premultiplying). However, the colors will not be exactly right, with compression.

Yeah i’m not familiar enough w/fireworks to make life good. :slight_smile: I just did the whole make a mask, save it to the alpha channel, and give everything a “similar enough coloured bg” to match. Works great. Its odd that it only happens on a “few” of my images( i’m working on a port btw… thus the png issue). I’d figured this woulda been an issue on everything that was alpha based but its not. Hey, can’t complain… i don’t have to redo every image. :wink:

In my experience, just opening the psd in Fireworks and saving it as a png from there solves it in most cases - but not in every case. I think it’s either because it saves 32 bit png’s, or because it’s smarter about which color to place behind your alpha colors.

Just to mention, sometimes, white lines appear when an image that’s meant to clamp the object is in repeat mode… Just change its wrap mode on inspector…

1 Like

Thanks mtet. You were right. It was the repeat mode. I changed to Clamp and it works perfectly.

Just to elaborate on the Fireworks method: If it doesn’t work, just create a rectangle that is bigger than the canvas, give it whatever color you want, and then set its object opacity to zero (just as you would if working in Flash). Then make that the bottom layer, save/export as PNG, and that should do it. You’ll still get a halo/fringe effect, just as you will with any of these methods. But if you want to go the FW route and it doesn’t always work, this is reliable.

Cheers,
-Adrian

P.S. Quite a necro.