Original Post
🔒 Locked
GL_LINEAR
Advertisement
I don't think so. I think you'll have to avoid GL_LINEAR because it also filters the Alpha channel. Try using GL_NEAREST and use an appropritely sized texture. If you use a texture that will be on the screen about the same number of pixels as in the texture file, the nearest filter will work fine.
The cyan ring around your sprite is because your color key is cyan. So replace that color with the color of the surrounding sprite.
I'm assuming you do the standard method of creating the alpha channel at run time based on the color of the pixels. Don't copy the color unconditionally. If the current pixel is opaque (don't match the color key), just copy it as usual. If the current pixel is transparent (matches the color key), and at least one of it's neighbours are opaque, set the color to the color of the sprite, not the color key. The color of the sprite can, for example, be the average of the opaque neighbours.
With this method, the ring will be the same color as the sprite, and will not be visible. And, of course, you can use linear filtering aswell.
I'm assuming you do the standard method of creating the alpha channel at run time based on the color of the pixels. Don't copy the color unconditionally. If the current pixel is opaque (don't match the color key), just copy it as usual. If the current pixel is transparent (matches the color key), and at least one of it's neighbours are opaque, set the color to the color of the sprite, not the color key. The color of the sprite can, for example, be the average of the opaque neighbours.
With this method, the ring will be the same color as the sprite, and will not be visible. And, of course, you can use linear filtering aswell.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement