|
AllegroGL |
Mariusz
Member #1,634
November 2001
|
Hi, First of all I am totally new to AllegroGL. What I am trying to do is to set background (bmp) and then blit a PNG image on top that has a alpha channel. My final goal is to achieve an alpha blending around the edges of a PNG image to make is a smooth as possible. Can anyone point me to some examples, please? Thank you, |
Steve Terry
Member #1,989
March 2002
|
glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); glBind(blah); Should be all you need. Allegro doesn't support PNG natively but you can use loadpng or a bitmap + grayscale mask to achieve the same effect. ___________________________________ |
Fladimir da Gorf
Member #1,565
October 2001
|
Maybe you should take a look at an Allegro add-on called OpenLayer. It's specifically suited for rendering 2D graphics - especially for rendering bitmaps with alpha channels (check the manual for Bitmap). With AllegroGL you can't (as far as I know) to rotate or stretch images with alpha channels or apply special effects to them. Also with AllegroGL you'll get a lot of overhead as it sends the bitmap data to the graphics card over and over when you render it. OpenLayer comes with all pre-built libraries which are required to load png images. Installing everything is only 3 copy-paste operations OpenLayer has reached a random SVN version number ;) | Online manual | Installation video!| MSVC projects now possible with cmake | Now alvailable as a Dev-C++ Devpack! (Thanks to Kotori) |
Bob
Free Market Evangelist
September 2000
|
Quote: Also with AllegroGL you'll get a lot of overhead as it sends the bitmap data to the graphics card over and over when you render it. Unless you just use video bitmaps, obviously. Quote: With AllegroGL you can't (as far as I know) to rotate or stretch images with alpha channels or apply special effects to them. You can't yet, but it's not too difficult to add now that Allegro has had the suitable enhancements. -- |
Fladimir da Gorf
Member #1,565
October 2001
|
Quote: Unless you just use video bitmaps, obviously. Well, that makes sense indeed. Quote: You can't yet, but it's not too difficult to add now that Allegro has had the suitable enhancements. Yeah, I've heard that Allegro will include functionality from AllegroGL and possibly even OpenLayer. The question is that how soon this will happen? OpenLayer has reached a random SVN version number ;) | Online manual | Installation video!| MSVC projects now possible with cmake | Now alvailable as a Dev-C++ Devpack! (Thanks to Kotori) |
Bob
Free Market Evangelist
September 2000
|
Quote: Yeah, I've heard that Allegro will include functionality from AllegroGL and possibly even OpenLayer. No that's not it. Allegro used to not have vtable entries for little things like stretch_bitmap(). This means that when you called stretch_bitmap(), Allegro software routines would kick in, even when you used AllegroGL! The recent changes to Allegro allow AllegroGL to overload stretch_bitmap() (and others) so that these calls can be hardware accelerated. -- |
Peter Hull
Member #1,136
March 2001
|
Quote: Unless you just use video bitmaps, obviously. Bob, I ran into a problem with this on Linux. It seems that video bitmaps are always 32-bit, and therefore if you don't ask for a 32-bit screen mode (or, in my case, ask for but don't get), Allegro diverts the blit to the colour-depth conversion code, which means that it runs slower than a memory bitmap would. Have you any thoughts on this? I guess you've been too busy recently to do much on Allegro GL? Pete
|
Bob
Free Market Evangelist
September 2000
|
Quote: Allegro diverts the blit to the colour-depth conversion code, which means that it runs slower than a memory bitmap would. I'm 99% sure I fixed that in Allegro. I guess it's still happening. Can you tell me which version of Allegro and AllegroGL you are using? Quote: I guess you've been too busy recently to do much on Allegro GL? I'm doing some much-needed improvements now. I should have an RC out today or next week (I hope). -- |
Peter Hull
Member #1,136
March 2001
|
Allegro: 4.2.0
Typical output: (times are in seconds) Quote:
mem 3.800000 Pete [edit] That was on Linux, on OSX I get the astonishing result of Quote:
mem 52.549999
|
Bob
Free Market Evangelist
September 2000
|
Can you check, under both Linux and OSX, which code path is being taken in AGL? -- |
|