alpha problem

Blitz3D Forums/Blitz3D Programming/alpha problem

stayne(Posted 2006) [#1]
i have a .b3d model made in 3dsmax that has multiple textures. one of the textures has an alpha masked texture (vines). no matter what I do, the alpha texture shows up in blitz3d with the black areas showing. i can't "entitytexture" the model because it has multiple textures. i've tried .png and .tga. has anyone had this problem?


stayne(Posted 2006) [#2]
i removed the mask channel from the 3dsmax material... now the black areas of the alpha map are white. heh?


Gabriel(Posted 2006) [#3]
EntityTexture has a layer parameter, specifically so that you can put multiple textures on models. If you mean multiples in different parts of the mesh, then you can do that with GetChild() and CountChildren() or FindChild() if you know the names of each "child".

If you want it masked, can you not remove the mask channel, just use the vine texture and paint on THAT texture the areas you want masked and then set that texture layer to use the masked flag?

Sorry if I'm a bit vague on the specifics, it's been a long time since i used b3d.


stayne(Posted 2006) [#4]
Thanks Gabriel. It seems the only solution is to use what you mentioned... GetChild(), etc.

Am I right in assuming that Blitz3D cannot read alpha infomration in a png or tga without having to set flags?


Gabriel(Posted 2006) [#5]
Yes and no. You should be able to set those flags in 3dsMax if you use B3D Pipeline. I vaguely recall that you can set up the flags automatically in code. There's a command called something-filter which lets you specify certain texture flags dependant upon the filename of the texture having a certain string in it. ( EG: "_Mask" on the end of a texture could be used to enable the mask flag. )

If you can't find it, I'll have to dig out some old code because I don't have B3D installed ATM.


stayne(Posted 2006) [#6]
Thanks. I wish I had more control over the textures of a loaded .b3d file. I'll take a look at the pipeline and let you know what I find.


kevin8084(Posted 2006) [#7]
it's called texturefilter. Example code from the IDE:



stayne(Posted 2006) [#8]
; This is where you would normally load your special
; textures.

I'm not loading textures. I'm loading a .b3d file. When you load a .b3d file, the textures are automatically applied. You don't have to use LoadTexure and EntityTexture.


kevin8084(Posted 2006) [#9]
I was posting the example code for the command that Gabriel had mentioned so that he/she didn't have to go to the trouble of digging out old code. Sorry that it doesn't help you.


Gabriel(Posted 2006) [#10]
( HE )

It does help you. TextureFilters still work regardless of whether you load the textures manually or they're loaded for you. That's the whole point of using them.


stayne(Posted 2006) [#11]
I do appreciate it kevin.

Gabriel... does that mean I can LoadTexture ("soandso,2") using the same name as the .b3d texture and the filter will be applied to it?


Gabriel(Posted 2006) [#12]
I'm not certain if that would work. I do believe Blitz loads textures intelligently ( IE: It doesn't load the same texture five times ) but I don't know if that holds true if you have different flags on them.

Try it and see, but if not, TextureFilters definitely works for you, because I've used it in a couple of major projects.


jfk EO-11110(Posted 2006) [#13]
Indeed blitz will only reuse an existing texure if name and flags are the same.


Gabriel(Posted 2006) [#14]
Ah, I suspected that might be the case. Thanks for clearing that up.

TextureFilters is your best solution then.


stayne(Posted 2006) [#15]
it was a b3d pipeline issue. sorted, slapped, flipped and rubbed down. flags!

thanks all!