Halo around masked sprites
I've got some sprites in targa format with an alpha channel that I'm trying to draw. I use "glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );" etc like I'm supposed to and everything works fine, except that there's a white halo around the sprites. I traced it back to the fact that I'm using a linear filter on the textures (nearest works fine). Is there any way to use alpha channels like this with a linear (or better yet mipmapped) textures without the halo? The sprites will be changing sizes so I'd really rather not use nearest.
The colors of the transparent texels of the texture should match the colors of the adjacent opaque texels.
GraphicConverter lets you see color independently from alpha, so you should be able to use it to fix this problem.
GraphicConverter lets you see color independently from alpha, so you should be able to use it to fix this problem.
You could also use the alpha test to give the sprites sharp edges.
You are probably using photoshop to create that image.
if so you are probably cutting the pixels you what to be transparent from the file, right?.
The solution is to paint the whole picture in the desired color ( light gray may be a good choice so you can conbine with glColor4f() )
then Add a new channel to the image, then paint the area you what to show in the image with black with antialias on.
Save the image and try again that should work perfectly.
Good luck and happy coding!!
if so you are probably cutting the pixels you what to be transparent from the file, right?.
The solution is to paint the whole picture in the desired color ( light gray may be a good choice so you can conbine with glColor4f() )
then Add a new channel to the image, then paint the area you what to show in the image with black with antialias on.
Save the image and try again that should work perfectly.
Good luck and happy coding!!
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Halo-Effect in 3D OpenGL ES | Bersaelor | 4 | 4,722 |
Dec 17, 2009 11:54 AM Last Post: Mark Levin |
|
| Masked Textures | Dan Potter | 1 | 2,050 |
Feb 26, 2005 10:07 AM Last Post: Dan Potter |
|
| 2D. Rendering to a Masked Texture | Zwilnik | 3 | 2,722 |
Mar 23, 2003 04:07 PM Last Post: Zwilnik |
|

