Overlaying textures on top of one another?

Blitz3D Forums/Blitz3D Programming/Overlaying textures on top of one another?

Bukky(Posted 2007) [#1]
Hey guys,

I'm having a bit of trouble overlaying textures on top of one another without performing any blending between them. I'm using multitexturing by way of calling EntityTexture with different indexes, and the only mode that I can get to look like it's not glitching out is 3, i.e. addition. Even using this though, the top texture is tinted by the hue of the color below it.

Basically I'm trying to get a blue character to put on a white t-shirt without having the t-shirt turn baby blue.


SLotman(Posted 2007) [#2]
just set the texture flags when loading them: 4 to use masks - every black pixel (0,0,0) will be transparent, or 2 to use alpha masks (the alpha value on the image will be used to determine what will be transparent and how much)


Bukky(Posted 2007) [#3]
D'oh! Thanks!


Bukky(Posted 2007) [#4]
Hmmmm, well that sort of worked.

How do I set up the textures so that everything under the alpha channel of the second texture doesn't disappear? Right now it looks like I have a white Tshirt walking around with no limbs :)


Bukky(Posted 2007) [#5]
Oh BTW, here are the calls that I'm making (in C++ using b3d SDK):


ninjaBlue=bbLoadTexture ( "ninja/nskinbl.jpg" );

ninjaWhite_top = bbLoadTexture("ninja/ninja_white_top.png",2 );

bbTextureBlend(ninjaBlue,2);
bbTextureBlend(ninjaWhite_top, 1);

bbEntityTexture(Player,ninjaBlue,0,0);
				
bbEntityTexture(Player,ninjaWhite_top,0,1);




Gillissie(Posted 2007) [#6]
Not sure, since my tests with the same kind of situation on a cube is working as expected. However, the B3D help does warn about multitexturing with alpha transparency, possibly giving unexpected results. Have you tested the same program on a different PC to see what happens?


SLotman(Posted 2007) [#7]
You dont need/have to set textureblend if already loading it with the texture flag. Remove that and it should work.

Also you posted on the wrong place, this is the Blitz3D forum, not the B3DSDK :P


Gillissie(Posted 2007) [#8]
SLotman, unless this is a SDK specific issue, I think it's legit to post in Blitz3D forum since it's using the standards functions.

That begs the question for Bukky... have you tried doing this in pure Blitz3D with the exact same commands on the same PC to see if it's an SDK issue?