B3D trees with smooth alpha leafs

Blitz3D Forums/Blitz3D Programming/B3D trees with smooth alpha leafs

3DFish(Posted 2006) [#1]
I've recently purchased a tropical tree pack, online.
The pack contains about 7 different model formats.

I have some trouble when I open the palm tree ms3d file in MilkShape3D and save it again as a b3d model.

1) When I load the existing b3d model in my game, it looks
perfectly like this.
See the leafs a smooth.


2) But when I open the ms3d file in MilkShape3D and export the b3d model, the leafs of the tree looses it's smoothness, like this:


Anybody know why this happens?


3DFish(Posted 2006) [#2]
Sorry guys..
The 2 pics needs to be swapped.

The bottom one is the smooth leafs.


Dreamora(Posted 2006) [#3]
Does MS3D export B3D with flags? Because you would need to be able to set the Textureflag for Alpha. I know that Ultimate Unwrap 3D is able to.

But you could use a little trick:

rename all your textures with alpha to something with a_ in front and then add the following code before loading any model:

TEXTUREFILTER "a_",2

(this should work)

this will add the texture alpha flag to all textures loading that have a_ at the beginning of their name


Naughty Alien(Posted 2006) [#4]
its look without mipmaping to me..


jfk EO-11110(Posted 2006) [#5]
no, masked flag (4) instead of alpha flag (2) to me.


Dreamora(Posted 2006) [#6]
Without mipmapping is not possible, thats default flag if you don't change it (or set the VRAM Flag)

I'm not sure if masking would result in such a smooth leaf as it only knows of "there" and "not there" ...


Pongo(Posted 2006) [#7]
JFK is correct. Here is an example showing some trees I have made.



The only difference is the following line.
leaves = LoadTexture ("leaves2_mask.png",1+4);mask version
leaves = LoadTexture ("leaves2_alpha.png",1+2);alpha version


note that the alpha version does not have correct z-depth,... this needs to be done in an extra step when using alpha blending.


3DFish(Posted 2006) [#8]
Thanks for all the feedback guys.

Great stuff Pongo..
The following line works 100%:
leaves = LoadTexture ("leaves2_alpha.png",1+2);alpha version

The leafs of the exported b3d from MilkShape are now just as smooth.

Cheers


Barliesque(Posted 2006) [#9]
@Pongo:
How do you correct the z-depth problem when using alpha blending?


jfk EO-11110(Posted 2006) [#10]
this is only a problem if the alpha stuff is part of the same mesh.
here's beakers z-sorting solution included:
http://www.blitzbasic.com/codearcs/codearcs.php?code=1273


Pongo(Posted 2006) [#11]
do a search in the code archives,... here is one:

http://www.blitzbasic.com/codearcs/codearcs.php?code=850