Transparent images

Blitz3D Forums/Blitz3D Beginners Area/Transparent images

SkyCube(Posted 2005) [#1]
Hello everyone,

I am looking for a way to create transparent images. I'm not talking about transparent in the "ignore-pixels-of-a-certain-color" kind of transparent. I want to know if there is a way to create a truly transparent, see-through image. I was able to do it by copying the image into a sprite, but this is not suitable. The reason is I'm trying to make a screen fade-out effect. I did it by positioning a sprite right in front of the 3d camera, copying the image to the sprite, then fading it out. However, because the 3d camera is still moving, the effect seems very choppy. So I wonder if, instead of using a sprite, a true 2d image can be used. Only I can't find a way to fade out a 2d image. Does anyone have any suggestions?


jfk EO-11110(Posted 2005) [#2]
Semitransparency and Crossfading using plain 2D is too slow. You may use the AlphaDLL by Mr. Credo: http://www.blitzbasic.com/toolbox/toolbox.php?tool=38 that is written in assembler and therefor it's faster.
But be warned, this is kind of a real Blitzhack and may not work on all Machines, nor will it be easy to implement.

The way people are doing "looking glass" stuff like semitransparent HUDs etc. it definitively to utilize the power of the 3D hardware. You need to create a QUAD, position it in front of the camera and parent it to the camera. You need to do this in a socalled "pixelperfect" way, that needs to follow some rules (see code archives).

In the end you'll be able to show any picure on a Quad (a mesh made of 2 Triangles, kind of like a Sprite) and it will look like the original Screen. Of course you will be able to show the Quad in any beloved Alpha Transparency. Crossfading will be as easy as "EntityAlpha quad,0.5".