Pink lines in blended textures.

Started by
7 comments, last by Leoncoeur 18 years ago
Hi. I've made a function for adding alpha channels for my bitmap textures that seems to work fine, the pink background on the texture is removed and becomes transparent. But it leaves a small line of pink about one pixel out from the texture. like this I reckon that it has something to do with mipmapping but I can't seem to solve the problem.
Advertisement
Hey bud,

This will be because the pink colour you are seeing here is not the exact correct colour for it to become transparent, due to is becoming blended with colours for smoothing with the pictures.

Hope that helps,

Dave
just a wild guess :

since your original bitmaps have a pink background you might get "slightly but not complete pink"-lines around your object due to antialiasing in your image manipulation programm.

check your source image (zoom in) to see if these lines are already there. if yes remove them. if not i don't have the slightest idea what may cause them ^^

chaos, panic and disorder - my work here is finished

There are two possibilities

1. you might have blended the edged with the pink in your image editor, check in your images that all pinkish pixels are truly pink and not blended.

2. Mipmapping blends the edges with pink, to fix this you can change the color to black at the same time you build your alpha maps.

Now i do suggest that you do tut33 so you can use true 32bit textures.
Hi. Thanx for the replies. But i dont thing any of them applies.
I have used photoshop and experienced this kinds of problems before. So now i use MS Paint :).
This is how the same section looks in paint

If im correct, there shouldnt be any antialliasing in paint right?
Don't use jpegs, they blend the pixels.
yeah.... I know... but the textures is .bmp and the images of the textures i put on the web are .jpg for my convinience... ;P
Quote:Original post by Leoncoeur
yeah.... I know... but the textures is .bmp and the images of the textures i put on the web are .jpg for my convinience... ;P

Is the texture filtering (smoothing) causing the pink to leak into the non-invisible sections? Try setting your filtering to NEAREST and see if it goes away.

If that is the problem then you can either:
1. Use a proper RGBA image rather than pink+preprocess.
2. Change your preprocessing. What I've done which works is when setting the alpha for a pink pixel you set the colour to the avarage of all adjacent non-pink pixels.
Changing the pink pixel to black before making it transparent worked.
Thanx guys for the fast help.

//Leo

This topic is closed to new replies.

Advertisement