Alpha transparency

BlitzPlus Forums/BlitzPlus Beginners Area/Alpha transparency

Roe(Posted 2005) [#1]
Hello again.

I've been searching these forums and I'm beginning to get a bit worried.

Is it true that Blitz Plus doesn't support alpha channel transparency using a .tga alpha channel or something similar??

This would be a huge blow to my game, because I'm relying on smooth antialiased sprites which are only possible if I can use an 8bit channel to determine transparency, rather than a flat colour.

can anyone shed any light on this, and any possible solutions as workarounds if this is indeed the case.

Cheers guys


Beaker(Posted 2005) [#2]
It is indeed the case. :/

You might be able to use a DLL to achieve what you want tho. I know there was one on blitzcoder for a while.

Failing that you will have to use 2D-in-3D (Blitz3D or BlitzMax).


Hotcakes(Posted 2005) [#3]
It should be noted that standard 2D in Blitz3D doesn't suppport alpha either.


Roe(Posted 2005) [#4]
I can't believe that alpha transparency has been omitted from an otherwise powerful programming language.

I think I need to look at changing to another Blitz.

I'm so annoyed! :(

cheers for answering again guys


sswift(Posted 2005) [#5]
My BOB system supports alpha sprites. Check out the demo. If only the edges of the sprites are antialiaed then it should handle what you want to do. Enabling triple buffering can also help depending on how many pixels are to be antialiased.


turtle1776(Posted 2005) [#6]
Hardware-based (meaning fast) alpha transparency was never built into Direct Draw, which is what both Blitz Plus and the original Blitz 2D programs are based on. If you want fast alpha transparency with those 2 programs, you need to use an external dll. I wrote one, called ExtendedB2D.dll, a few years back (that's what was mentioned above), but I am no longer updating it.

Alpha transparency can be achieved quickly using Direct3D, which Blitz3D is based on, or OpenGL, which is what BlitzMax is based on. I have not used Blitz3D much, but I know it is a bit complicated if you are not used to it. I do not own BlitzMax, but I understand that alpha transparency is built into the 2d drawing command set.


Simon S(Posted 2005) [#7]
Yep, the only way to get transparency in Direct Draw is to read the pixels in one at a time and calculate the values yourself. This is of course, hugely impractical for real time graphics.

I can vouch for Turtle's dll however. It's excellent. Although I never actually finished a project in it, this down to my own downright lazyness, rather than any problems with the dll. It's fast and fits in well with the standard Blitz commands. The only thing to beware of is that, like all modern transparency effects, it demands a 3D card.

I've since moved to BlitzMax which does most of the ExtendedB2D.dll stuff by default, but I do miss the excellent Drawquad command that let you stretch the corners of a shape anywhere on screen.

The one thing I can't remember off the top of my head is if the dll does the alphablend mode you need to do your fancy antialias. I'm pretty sure it does but I never actully used alpha channels before I moved to blitzmax.

I'm sure Turtle can confirm if it's in there, and if it is, then I'm sure it's just what you're looking for.


Regular K(Posted 2005) [#8]
Ive managed to write a command for B+ that can handle up to 32,000 pixels for alphaing, it works for small alpha jobs, but probably not what you want it for.

Im wondering, could realtime alpha be done by using OpenGL in B+?


sswift(Posted 2005) [#9]
I've decided to give my BOB system and anibob system away for free, so you can use this if you need alpha:

http://www.seamlesstexturegenerator.com/SwiftBOBS102.zip


Grey Alien(Posted 2005) [#10]
Wow that's pretty neat thanks!


Kuron(Posted 2005) [#11]
I've decided to give my BOB system and anibob system away for free
WooHoo! I love you man!! Thanks! I have always meant to order this, but never got around to it.