Alpha-chromakey'ing in B3D!

Blitz3D Forums/Blitz3D Programming/Alpha-chromakey'ing in B3D!

BerhanK(Posted 2003) [#1]
I wrote about this but it should be called what it is:
so here we go!

I have a 3d room (b3d file) texture mapped and parts of some objects will be transparent.

I want to know if it can be done with just alpha-chromakeying, ie. using alpha chanel of the texture map to tell
blitz3D that this part of the object should be more transparent than the rest?!


Beaker(Posted 2003) [#2]
Yes. Use flag 2 on the LoadTexture() or CreateTexture() command.


Rob(Posted 2003) [#3]
Make sure you use PNG or TGA as these contain alpha. We don't call it chromakeying. Just alpha will do.


jfk EO-11110(Posted 2003) [#4]
If you are using 24 Bit Images Blitz will use the Pixels Brightness for the Transparency (white=opaque, black= transparent), but if you use 32 Bit images (as Rob said TGA or PNG ) then the most significant Byte will be used as a Pixelcolor-independent alpha-Value.


BerhanK(Posted 2003) [#5]
Guys, the problem is slightly more complex than so..
The whole scene is using same texture, so I guess I have to
Split the textures per object.

Still the whole scene is only one entity so it wouldn't work to load an alphamap(for the surface of the leafs of the plant) coz I don't know how to tell blitz that this texture being loaded is only for a certain surface.

Can it be done?

I mean parsing trough the b3d model and checking for surface name and then loading a proper texturemap, shadowmap/alpha map ?!

Thank you!


Binary_Moon(Posted 2003) [#6]
so you're loading the model as a 3ds/x and you want some textures to load with alpha transparency?

Look up the texturefilter command - that should sort you out.


BerhanK(Posted 2003) [#7]
I am loading a b3d model ( a complex scene)
and it has a plant that needs some parts to be transparent.

I use only one texture for the whole scene.
I add an alpha channel for the transparency thing but it doesn't work, and texturefilter command doesn't help me either!

anything else you can think of?


Beaker(Posted 2003) [#8]
You are going to have to split the alpha textured surfaces from the non-alpha textured surfaces. If you really must use the same texture twice then you are going to have to load it in twice:
tex = LoadTexture("spark.bmp",2)
tex2 = LoadTexture("spark.bmp")



BerhanK(Posted 2003) [#9]
MB, sounds logical of course, but is this THE way to
use the alpha chanel for making some parts of an object invisible/transparent?

Remember I use only one big bicture for the texture maps for the whole scene.


BerhanK(Posted 2003) [#10]
see the screenshot:



Beaker(Posted 2003) [#11]
It is the way. You really don't want to apply the alpha flag to all your textures, do you? Think of the slowdown and z-ordering mess.

The picture you posted tells me very little, unfortunately.


BerhanK(Posted 2003) [#12]
ok, what I want is to :

1) make the leafs of this plant slightly more transparrant
(in this pic - the trunk of the flower should be smaller (greyish should be transparrant)
see here:




I thought I could make the greyish color transparent and the edges of the leaf..

Mind that the whole scene is using one texture.
so I want to have an alpha channel, for just plant transparency bit.

Is it possible or do I have to use an own surface(with own texture) for the plant alone..

Regards