Overlay this smooth transparent alpha gradient over a full screen image and you will see the alpha is not smooth but has a banded edge. Try using a light coloured image to overlay on top of as it will depict the problem far better.
This needs fixing as true alpha is not being represented properly :-(
[attachment deleted by admin]
Are you using SMOOTHSHADING ?
Yep set to TRUE, although changing it to FALSE or completely commenting it out makes no difference :-(
This is what I get with GLB compared to Photoshop.
[attachment deleted by admin]
Did you try using -0.9999 instead of -1?
I noticed this same problem when adding my fake blob shadows.
They would band at the edges, no matter what alpha values I chose.
I did an experiment and found that the cut-off for the alpha was around 15 (out of 255).
Any alpha below this wouldn't render, and the first value above would show not very transparent.
I used the command 'ALPHATESTING 0' and the problem went away.
Not sure if this is set once, or per frame.
Hope this helps you in your situation.
I just tested with 'ALPHATESTING 0' & it did cure the problem.
Lee
Here are my before and after shots of my shadow:
[attachment deleted by admin]
QuoteI did an experiment and found that the cut-off for the alpha was around 15 (out of 255).
Slydog, If you have the time could you expand a little on what you meant by the above please.
In my 'before' screenshot above, notice how the shadow suddenly turns to fully transparent, creating a visible line cutoff around the shadow, as opposed to a gradual fading out of the alpha as seen in the 'after' shot.
What I did to find this '15' value was in Paint.NET I created various rectangles over top of my shadow sprite.
Each rectangle had an different alpha value, gradually increasing.
You can set/view the alpha in the 'Colors' dialog.
Whenever I used a rectangle with an alpha below 15, it would not render in GLBasic.
Any alpha above this cutoff would show a transparent rectangle with a distinct edge.
Again, the '15' value is from memory, could be a little higher / lower.
I was just trying to figure out whether I was using the blurring tools properly.
I guess I was and GLBasic was to blame! :D
Yes, I had similar problems but this was in version 8 or so. Haven't done much with alpha since then. Alpha only changed every 8 or 16 steps, can't remember more exactly but it felt like there was a bit missing somewhere.
Ha, ya I guess with that number 15/16 it appears to be only 4 bits, funny how I didn't notice this!
But is it only 4 bits, or does it just cut-off/ignore the lowest 15 alpha values?
The remaining gradient appears to be smooth. (or does it?!)
But then the question is: why does 'ALPHATESTING 0' fix the problem?
Or at least APPEAR to fix the problem?
What does this command do behind the scenes?
After you find the color space it is using, you can dither to achieve similar results maybe O_O
Using ALPHATESTING 0 has also fixed some problems with alpha not been applied with alphamode -1 .
So I dont know whats happening but it works!
alphatesting will test and make all pixels of alpha < 0.05 be totally transparent. (no blending)
I have been confuction about this issue as well (so called multiply issues). Here I fixed it by using ALPHATESTING 1.
Those kind of issues should have been documents in the help file, since its can been very confuction about it.
Regardless of ALPHATESTING value fixing it. ALPHAMODE -1 should just work shouldn't it? I'm looking at the ALPHATESTING in the help file and at first glance can't make head nor tail of it :)
ALPHATESTING 0 each frame works perfectly.
One oddity I found is that alpha blending seems to work fine for my images if ALPHATESTING 0 or ALPHATESTING 1.0 is used each loop but not if ALPHATESTING is not called at all. In the help file it states that ALPHATESTING 1.0 totally disables alpha tests.
So...I guess I'll be using ALPHATESTING 1.0 and also having correct alpha blending then. O_O
alphatesting only decides what source alpha will be considered as a hole in your sprite. No pixel will be drawn, no z-buffer will be touched if alphatesting skips.