x


Pixel wide border artifact on texture loaded from file

Hey,

I've successfully managed to load a .png file to a texture and display it on a programmatically generated mesh. However, I've noticed that for some reason Unity is adding a pixel wide border to the texture that doesn't seem to bear any relation to the texture itself, although it is made up of a mixture of roughly the same colours.

alt text

In the above image it can most clearly be seen at the top border as a darker, single pixel wide line. Its also probably worth noting that the white background is actually transparent in the image.

I have no idea why its doing this, because I've gone back and checked to make sure the image is saved properly, and there is no border showing when I look at it in GIMP.

Any help would be greatly appreciated,

Wibbs

more ▼

asked Mar 16 '11 at 02:48 PM

Wibbs 1 gravatar image

Wibbs 1
331 5 6 18

(comments are locked)
10|3000 characters needed characters left

3 answers: sort voted first

You could take a look at this answer: Messy Alpha Problem - White around edges
And if the texture is not tiled, you should set Wrap Mode to Clamp.

more ▼

answered Mar 16 '11 at 04:15 PM

efge gravatar image

efge
5.1k 5 14 38

Setting the wrap mode to clamped sorted it - thanks

Mar 16 '11 at 04:49 PM Wibbs 1
(comments are locked)
10|3000 characters needed characters left

It's necessary if you don't premultiply your alpha.

http://www.youtube.com/watch?v=sMR_R72bWzw

There's not much point looking at RGB channels of a non-premultiplied image, unless there's a problem in the rendering that needs correcting.

more ▼

answered Mar 16 '11 at 04:49 PM

Jessy gravatar image

Jessy
15.6k 72 95 196

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x353
x256

asked: Mar 16 '11 at 02:48 PM

Seen: 2524 times

Last Updated: May 20 '12 at 10:18 AM