Game Development Community

Weird Image Transparecy

by Sam.E · in Torque Game Builder · 11/13/2008 (11:48 pm) · 5 replies

Can someone please help me, I have made the background of an image transparent so it looks good in my game and it ends up having a white line after I put it in the game, but when i test it in a website it works perfect.

Here is a "test" image, it has been enlarged inside TGB.

www.freewebs.com/zalenthio/jjj.JPG
How would I be able to take the white line away, also when it is on its normal size it still has that white line.

#1
11/14/2008 (4:54 pm)
No one can help me with this?
#2
11/14/2008 (5:02 pm)
Looks like a filtering problem. Is the background of the image white? If so, you can work around the issue by padding the images.
#3
11/14/2008 (9:20 pm)
No the background of the image is transparent but in the game it is black.
#4
11/21/2008 (8:44 pm)
Either turn filtering off, or paint the pixels around the red part of your image red and the green parts green. Those pixels are currently white, with black alpha, so the red outline is blending into the white pixels. You'll need the superPNG plugin for photoshop to do this properly - it's on the TDN somewhere, just search for superPNG.
#5
11/22/2008 (2:51 pm)
Conor is spot on here. The GPU is interpolating the colours andalpha channel when bilinear filtering is on. This means that your red (opaque) is blending to the surrounding colour (transparent). This is done due to the way bilinear filtering works.

Ensuring that the surrounding texels in your texture are the same colour as your object will remove this effect. Essentially add a halo around the artwork that's a copy of the connected texels. You can then make them completely transparent.

Melv.