I am seeing something quite annoying when using TGA files with an alpha-channel set in OpenGL - I get a rough border around the image of the background colour, even though it looks really neat and separated in other programs like Paint Shop Pro or TGATool. This screenshot should illustrate what I am seeing:
Is there any way to avoid this? The TGA file itself is located here if anyone wanted to see if they got the same issues when using in OpenGL - I am using Textures.pas version 1.03 from 1 May 2001 which is working so well for me in all other respects.
Registriert: Do Dez 05, 2002 10:35 Beiträge: 4234 Wohnort: Dortmund
The Texture isnt a power of two texture. The Textures.pas using the gluBuild2dMipMaps function to upload the texturedate. Bis this function automatically resize your image to power of two. I thing it will made an 256x512 large image. The glu function interpolate the image data linear wich means that your will get an smooth gradient to red. Because the transparent background has as RGB values red.
One thing what you must do is to remove the transparent red background. Fill the background with some light gray. If you stretch the texture in OpenGL the linear filtering of OpenGL will produce the same red border. But if the back is light gray (same as the controler) it will fade gray to gray. Now he faded gray to red.
Second. You should rescale you controler in psp to 160x512 and then expand the image to 256x512. You have more transparent space at left and right. But so the aspect ratio is the same as the original image. On your screen you can see that the controler is much wider than original. And the gluBuild2DMipMaps dont change any on the image.
[edit] I edited your post. Because the image is large. So its better for the design from the forum.
Thank you. I am making some good progress doing what you described - it looks 10x better now anyway, with the grey instead of red. I still have a few pixel artefacts that don't look right at the bottom of the image, but I will work on seeing if I can get rid of these by, maybe, making sure the whole bottom line of pixels is the alpha-channel colour.
Mitglieder in diesem Forum: 0 Mitglieder und 5 Gäste
Du darfst keine neuen Themen in diesem Forum erstellen. Du darfst keine Antworten zu Themen in diesem Forum erstellen. Du darfst deine Beiträge in diesem Forum nicht ändern. Du darfst deine Beiträge in diesem Forum nicht löschen. Du darfst keine Dateianhänge in diesem Forum erstellen.