Author Topic: Opacity Problems  (Read 3768 times)

Thunor

  • Guest
Opacity Problems
« on: 2008-Jan-17 »
Hi

I've been playing around with GLBasic with the intention of entering into the GP2X competition. I see that GLBasic supports RGBA images and I was intending on using this feature so that I could animate sprites over complicated backgrounds, but I am not getting the same results as using pre-rendered images. For example I created this image in Macromedia Fireworks, the top image having 100% opacity, the second 60% opacity, the third 40% opacity and the fourth 20%.



The following image is a screen-shot of GLBasic rendering "Testing..." over a patterned background. "Testing..." is a png32 RGBA image, 100% opaque with a transparent background and a black glow and loaded using LOADSPRITE. The top sprite uses ALPHAMODE -1, the second ALPHAMODE -0.6, the third ALPHAMODE -0.4 and the fourth ALPHAMODE -0.2.



So am I doing something wrong?

Regards.

P.S. The forum is reducing the size of the images above so right-click and select View Image to see them full size.

Offline Moru

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1792
    • View Profile
    • Homepage
Opacity Problems
« Reply #1 on: 2008-Jan-18 »
Try a positive Alpha value and see what you get.

Thunor

  • Guest
Opacity Problems
« Reply #2 on: 2008-Jan-20 »
Quote from: Moru
Try a positive Alpha value and see what you get.
I tried that but it makes the image brighter.

ALPHAMODE is good for a simulated mouse pointer shadow but I've decided to use pre-rendered images over a plain background.

Tack

Offline Moru

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1792
    • View Profile
    • Homepage
Opacity Problems
« Reply #3 on: 2008-Jan-21 »
Ok, was just an idea, haven't played around much with it yet :-)


Varsågod :-)

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10757
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Opacity Problems
« Reply #4 on: 2008-Jan-30 »
Can you upload the "testing" image, please?

Thunor

  • Guest
Opacity Problems
« Reply #5 on: 2008-Jan-31 »

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10757
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Opacity Problems
« Reply #6 on: 2008-Jan-31 »
OK.
There's 2 things here.
First, GP2X/PocketPC/X-Box Linux do not support alpha-values in images. Only transparent, or opaque. Thus, the result might slighty differ from what you expect. No big deal, though.

Second, my appologies. Oh feel so dull. You discovered a bug that is in for about 7 years now. With alpha blending, I also faded colors to grey. I so, so apologize. (Look at all the colors on the wall... :happy:)

I fixed it, but I take some time to upload an update. It's so deep, I have to really really check if everything's working, still.

Thank you so much for finding this one.