Registriert: Do Sep 04, 2008 11:30 Beiträge: 7 Wohnort: England
It looks like I need to load PNG files into textures (I suspect that I need a transparent textures to achive the look I want). I know how to load BMP or JPEG files, is there something similar for PNG?
The effect I want to achieve is something similar to NeHe Lesson 9 (I haven't worked out how to include images here), coloured glowing disks with radial streaks that fade to the tips moving about. But these fancy disks need to be specific colours, moving on any coloured background. Using single texture and glBlendFunc(GL_ONE, GL_ONE) works for coloured disks on a black background, or white disks on any colour, but of course colour on colour gets blended.
My card is too ancient to handle point sprites (which may or may not have helped). Is texture with alpha channel data the way to go? I haven't managed to create a transparent texture yet to know for sure. Any suggestions?
I use SDL_Image for Loadings Images.
I use only transparent pngs for my applications.
_________________ Denn wer nur schweigt, weil er Konflikte scheut, der macht Sachen, die er hinterher bereut. Und das ist verkehrt, denn es ist nicht so schwer, jeden Tag zu tun als ob's der letzte wär’. Und du schaust mich an und fragst ob ich das kann. Und ich denk, ich werd' mich ändern irgendwann. _________________Farin Urlaub - Bewegungslos
Registriert: Do Sep 02, 2004 19:42 Beiträge: 4158
Programmiersprache: FreePascal, C++
If you are working with Delphi and you are willing to replace your code with a larger library, I can recommend the glBitmap by Lossy eX. It is object oriented, supports multiple backends to load some formats and is quite fast, even with large images.
greetings
_________________ If you find any deadlinks, please send me a notification – Wenn du tote Links findest, sende mir eine Benachrichtigung. current projects: ManiacLab; aioxmpp zombofant network • my photostream „Writing code is like writing poetry“ - source unknown
„Give a man a fish, and you feed him for a day. Teach a man to fish and you feed him for a lifetime. “ ~ A Chinese Proverb
Registriert: Do Sep 04, 2008 11:30 Beiträge: 7 Wohnort: England
Thanks for the suggestions, but this is turning out more complicated than I initaily thought. Just how hard can making a transparent texture be?
I don't really want to use the SDL library, overkill for my 2D app, so that rules out SDL_image (I think). My C is pretty rusty too, and the compressed code style of PicoPNG just made my head hurt when I considered writing a Delphi equivalent. So I am looking between glBitmap and FreeImage.
Google translator from German to English didn't make much sense of the glBitmap pages, but I think my issue here is getting the right DLLs to support the loadPNG library that it uses. The loadPNG site doesn't seem to offer a download, so not sure how to get this working either. I think I have figured out how to use FreeImage to build a texture, so I guess that will be how I go.
Meanwhile I have tried making a transparent texture programmatically, but this is not rendering as I expected either. Is it possible to render a single texture, that is transparent in places, in different colours? That is some red fussy disks here, blue there and all uneffected by background colour. Seems that when I blend for the transparency, the colour of the texture has to blend too.
Some more help would be greatly apprectated.
Zuletzt geändert von Dave Blake am Sa Okt 24, 2009 12:03, insgesamt 1-mal geändert.
Registriert: Do Sep 02, 2004 19:42 Beiträge: 4158
Programmiersprache: FreePascal, C++
I see, you have a problem with the german descriptions. So to use glBitmap for loading png images, you just need the libpng.dll *or* you can even go without any dll by using the pngimage.pas which should be findable using google.
Which variant is to be used is decided by the compiler directives in the head part of the glBitmap.pas. There you also find english descriptions.
good luck & greetings
_________________ If you find any deadlinks, please send me a notification – Wenn du tote Links findest, sende mir eine Benachrichtigung. current projects: ManiacLab; aioxmpp zombofant network • my photostream „Writing code is like writing poetry“ - source unknown
„Give a man a fish, and you feed him for a day. Teach a man to fish and you feed him for a lifetime. “ ~ A Chinese Proverb
Mitglieder in diesem Forum: 0 Mitglieder und 1 Gast
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.