png files with transparency in openGL?
Can you use png files with transparency in openGL or do you need to use a masking technique and bitmaps, like the masking example on NEHE?
Just wondering, if you can are there any tutorials or examples?
thanks,
pixpooch
Just wondering, if you can are there any tutorials or examples?
thanks,
pixpooch
Yes, you can use PNG files with alpha in OpenGL.
You'll need to combine blending (I think NeHe has a tutorial) with some code to actually load the PNG (For example, as in QTValuePak on this site).
You'll need to combine blending (I think NeHe has a tutorial) with some code to actually load the PNG (For example, as in QTValuePak on this site).
I couldn't get png with an alpha channel to work right but I used the glpng library at the time also so maybe that was part of the problem. But it seemed like PhotoShop didn't save the alpha channel in png's. But I didn't look into it too much since it worked fine when I switched to tiff's.
KenD
KenD
Quote:Originally posted by pixpooch
Can you use png files with transparency in openGL or do you need to use a masking technique and bitmaps, like the masking example on NEHE?
![]()
Yes...
You need to down load glpng
do a search in google are you should fined it.
What it does is load PNGs properly into GL textures for you...
loads the alphas and all sorts of other options also.
PhotoShop does save the alpha channels in PNGs though they keep changing ps so it may take some playing with to get it working depending on what version of ps you use.
But it DOES WORK.
Quote:Originally posted by ChrisDGet the (free) SuperPNG plugin for Photoshop: http://www.fnordware.com/superpng/
PhotoShop does save the alpha channels in PNGs though they keep changing ps so it may take some playing with to get it working depending on what version of ps you use.
But it DOES WORK.
It will save you *many* a headache (PS7's PNG-w/alpha support is broken as far as I can tell).
Quote:Originally posted by Frank C.
Get the (free) SuperPNG plugin for Photoshop: http://www.fnordware.com/superpng/
It will save you *many* a headache (PS7's PNG-w/alpha support is broken as far as I can tell).
No Alpha is not broken in PS7
Your just doing it wrong...
How are you making your alpha channel?
Quote:Originally posted by ChrisDI should have said: "broken as far as I'm concerned"...
No Alpha is not broken in PS7
Your just doing it wrong...
I prefer "old school" alpha channels (which PS7 doesn't allow when saving PNG). The "transparent layer" approach is destructive if you're using the same image with multiple (and different) alpha maps. There are ways around it like multiple copies, or multi-layered working files, but I prefer the old methods (got old dog new trick syndrome).
Silly thing is, Adobe released a new TGA plugin that restores the "old" style alpha channels (after many complaints) but failed to do the same for PNG - unless I missed it.
SuperPNG gives you more options than PS's built-in PNG regardless.
Quote:Originally posted by Frank C.
I should have said: "broken as far as I'm concerned"...
I prefer "old school" alpha channels (which PS7 doesn't allow when saving PNG). The "transparent layer" approach is destructive if you're using the same image with multiple (and different) alpha maps. There are ways around it like multiple copies, or multi-layered working files, but I prefer the old methods (got old dog new trick syndrome).
BLAH... I don't like the new method either...
At first I thought it was broke also...
Quote: Silly thing is, Adobe released a new TGA plugin that restores the "old" style alpha channels (after many complaints) but failed to do the same for PNG - unless I missed it.
SuperPNG gives you more options than PS's built-in PNG regardless.
How does the plug in work?
I mean can you know make a plug in that changes how layers work?
or is it only at save time that anything takes effect?
Quote:Originally posted by ChrisDIt's just a file format plugin that shows up as "SuperPNG" in Save/Open dialogs in the list of supported formats.
How does the plug in work?
I mean can you know make a plug in that changes how layers work? or is it only at save time that anything takes effect?
You can actually keep the original PS PNG plugin installed and use them side-by-side, but PS will default to it's own PNG format if you double click or drag & drop a PNG file to open it (and mangle the alpha channel into a layer transparency).
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Sprite transparency in OpenGL? | Guest! | 26 | 24,117 |
Feb 17, 2012 09:24 AM Last Post: Skorche |
|
| OpenAL - Ogg files vs Caf files | Fred9000 | 8 | 11,774 |
Aug 23, 2011 08:01 PM Last Post: ipeku |
|
| OpenGL ES 2.0, 2D Alpha Transparency Artifacts | Macmenace | 3 | 6,096 |
Mar 28, 2010 11:18 PM Last Post: AnotherJake |
|
| libpng transparency problem | wyrmmage | 3 | 4,253 |
Mar 1, 2007 05:53 PM Last Post: OneSadCookie |
|
| Strange transparency errors... | thingythekid | 4 | 3,992 |
Aug 24, 2005 05:01 AM Last Post: thingythekid |
|

