alphaentity for a certain part

Blitz3D Forums/Blitz3D Programming/alphaentity for a certain part

Akat(Posted 2003) [#1]
how do i set a certain mesh become tranparent like a POD. lets say i have a jet mesh where the HUD will be transparent to see the pilot inside... i know i can alpha the mesh but not for a certain part in the mesh...


_PJ_(Posted 2003) [#2]
Isnt it something to do with VertexColouring?


jhocking(Posted 2003) [#3]
It depends on if the model is comprised of a single mesh or multiple parts. If it is multiple parts then each child object is a separate entity and you can just use EntityAlpha. If the model is a single mesh you will need to use the alpha channel of a TGA texture. Note however that setting alpha on will remove z-buffering for that object so, to avoid serious draw order problems, you will probably want to go with the first method and actually model the semi-transparent parts as separate objects from the rest of the mesh. In other words the glass over the jet is a separate child object attached to the jet.


Skitchy(Posted 2003) [#4]
This can all be set in the guts of a .B3D file. If the HUD is using a separate texture then LightBulb can sort it all out for you. All you'd have to do is give the texture a special name that would tell the exporter it needs to be alpha'd (something like 'HUD@...' would set the alpha to 0.5).
Then, when you load the .B3D into your engine, all the texture tricks like alpha are set up automatically, and you don't even need any special code.

This trick isn't limited to alpha - you can set up all the other texture flags this way eg. fullbright, backfacing, spherical reflection, etc.


jhocking(Posted 2003) [#5]
Good point. I forgot that you can set BrushAlpha so it doesn't need to be a separate object; even in a single mesh you can set alpha for just transparent parts if they are a different surface (and that usually means applying a different texture.)


Jeppe Nielsen(Posted 2003) [#6]
what about vertexcolor ?:

VertexColor surface,index,r,g,b,[alpha#]


jhocking(Posted 2003) [#7]
That would work but is a little harder because you'ld have to set vertex alpha for every vertex in the part you want to make transparent. It would just be a simple loop but you can accomplish the exact same thing with alpha for the brush/surface using only one line (or no code at all if you set it within the b3d file, using Lightbulb or B3D Tweak.)


Akat(Posted 2003) [#8]
yup... i got it, lightbulb is the solution for not just wasting my time coding... too lazy around this day...