Files |  Tutorials |  Articles |  Links |  Home |  Team |  Forum |  Wiki |  Impressum

Aktuelle Zeit: Di Jun 04, 2024 12:08

Foren-Übersicht » English » English Programming Forum
Unbeantwortete Themen | Aktive Themen



Ein neues Thema erstellen Auf das Thema antworten  [ 3 Beiträge ] 
Autor Nachricht
BeitragVerfasst: Sa Jul 07, 2007 14:09 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jan 24, 2007 00:44
Beiträge: 144
Hello,

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:

Sample Image (180Kb)

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.

_________________
Cheers, DpM
http://www.hmusiccentre.org.uk


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Sa Jul 07, 2007 14:39 
Offline
DGL Member
Benutzeravatar

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.


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags: Good advice!
BeitragVerfasst: Sa Jul 07, 2007 20:28 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jan 24, 2007 00:44
Beiträge: 144
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.

_________________
Cheers, DpM
http://www.hmusiccentre.org.uk


Nach oben
 Profil  
Mit Zitat antworten  
Beiträge der letzten Zeit anzeigen:  Sortiere nach  
Ein neues Thema erstellen Auf das Thema antworten  [ 3 Beiträge ] 
Foren-Übersicht » English » English Programming Forum


Wer ist online?

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.

Suche nach:
Gehe zu:  
  Powered by phpBB® Forum Software © phpBB Group
Deutsche Übersetzung durch phpBB.de
[ Time : 0.008s | 14 Queries | GZIP : On ]