DGL https://delphigl.com/forum/ |
|
PNG file loader for transparent textures https://delphigl.com/forum/viewtopic.php?f=19&t=8759 |
Seite 1 von 1 |
Autor: | Dave Blake [ Do Okt 22, 2009 19:07 ] |
Betreff des Beitrags: | PNG file loader for transparent textures |
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? |
Autor: | Ziz [ Do Okt 22, 2009 21:35 ] |
Betreff des Beitrags: | |
I use SDL_Image for Loadings Images. I use only transparent pngs for my applications. |
Autor: | Stucuk [ Do Okt 22, 2009 22:27 ] |
Betreff des Beitrags: | |
FreeImage is good at loading multiple file formats. It has a Delphi wrapper. |
Autor: | Philip [ Fr Okt 23, 2009 09:17 ] |
Betreff des Beitrags: | |
In a C++-Project, I used PicoPNG. Very small and nice. ![]() http://members.gamedev.net/lode/projects/LodePNG/ |
Autor: | Lord Horazont [ Fr Okt 23, 2009 09:58 ] |
Betreff des Beitrags: | |
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 |
Autor: | Dave Blake [ Sa Okt 24, 2009 11:19 ] |
Betreff des Beitrags: | |
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. |
Autor: | Lord Horazont [ Sa Okt 24, 2009 11:59 ] |
Betreff des Beitrags: | |
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 |
Seite 1 von 1 | Alle Zeiten sind UTC + 1 Stunde |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |