GLBasic forum

Main forum => GLBasic - en => Topic started by: bigsofty on 2007-Mar-23

Title: PNG Alpha Channels for Sprites
Post by: bigsofty on 2007-Mar-23
Is there a way to get a 2D Sprite, to control its transparency via the alpha channel of its PNG?

Also how do I achieve additive blending (in opengl something like... GlBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA)) in 2D?
Title: PNG Alpha Channels for Sprites
Post by: Kitty Hello on 2007-Mar-23
Sure. PNG transparency is supported. Alpha blending comes from command ALPHAMODE. If you need a different mode, try using INLINE.
Title: PNG Alpha Channels for Sprites
Post by: bigsofty on 2007-Mar-23
Thanks Gernot,

2 questions...

My PNG has an 8 bit alpha channel, is there a way that I can use the full 8 bits for different levels of blending?

Also...

If I use inline to change the blending mode... how would this affect the cross platform compilation (Is this opengl command supported in your PDA/GP2X OpenGL libs?)

Thanks for the info...


Ian
Title: PNG Alpha Channels for Sprites
Post by: bigsofty on 2007-Mar-23
P.S. Small bug in code completion within the editor... type "func" and then CTRL+T, you get "FUNCTION" but the cursor seems to get located before the 1st character, in the gutter, not at the end of the code completed word.
Title: PNG Alpha Channels for Sprites
Post by: Kitty Hello on 2007-Mar-23
thx. OpenGL calls are platform independent.
Title: PNG Alpha Channels for Sprites
Post by: bigsofty on 2007-Mar-23
Excellent! I'll give the Inline call a go... :)

And question one?