Transparency (not masks)

BlitzPlus Forums/BlitzPlus Programming/Transparency (not masks)

aab(Posted 2004) [#1]
i'm looking for proper transarency effects, where thing such as clouds,smoke etc, can be made partially visible so that they can overlap the screen: eg: the mist in the Lost Woods in Zelda 3.

I've tried different things: such as making the image only appear every second millisec:
-----------------------
If MilliSecs() > tmrS+1 Then
tmrS=MilliSecs()
transfrm=(transfrm+1) Mod 2
EndIf
If transfrm=1 DrawImage mist,x,y
-----------------------------
I've also tried using this:
timeroddeven=timeroddeven+1
if timeroddeven=2 timeroddeven=1
if timeroddeven=1 drawimage mist,x,y

----------------------------
The end result is always the same: a rapidly flashing, flickering transparency that destroys the atmosphere i was after, making it pretty useless.....
Can anyone help?


aab(Posted 2004) [#2]
----


Valgar(Posted 2004) [#3]
The only thiong that i have come up is making the sprite that you want to be "transparent" made up of checkered pixel.....one pixel of the image and the other of the masked color and so on....it's not too beautifoul to see but it's the easiest way...or you could try Gosse library,nsprite (that use mapped poligon so you can have alpha channel).


aab(Posted 2004) [#4]
this is what i used to use, but im working on low resolution to save memory (and recreate snes style): 320,240-the pixels are just too large for checks!
-Thanks 4 ur help though!


Valgar(Posted 2004) [#5]
I think that's a problem of the directx do not have transparency for 2d sprites.


Zster(Posted 2004) [#6]
Try prerendering. Provided you know what the mist will be covering you can alpha blend using software first capture all the images and make a really large animated frame that you can cycle through depending what frame is under it. Although at 320x240 using locked banks you may be able to do the whole thing fast enough in software and some look up tables.


Bremer(Posted 2004) [#7]
There is a function in the code archieves that does something like that in B+.

http://www.blitzbasic.com/codearcs/codearcs.php?code=913


aab(Posted 2004) [#8]
Thanks!