Alphastate

ok, i found a way to create low polygon models, we can trick the users into thinking that the model is of a good design, this is used for trees, using 3ds max we can just put about 20 panels together in order to cover up all the angles then we put a texture of leaves onto the panel, preferably with a load of white dots in the texture, here is my question, i can use Alphastate to show everything except for the white dots so it looks like a proper tree in the game, How can i do this?



i hope the explaination is ok,



thanks

Use a texture with an alpha channel, like png or tga etc. Then just apply an AlphaState to the tree, for example like this:



AlphaState as = DisplaySystem.getDisplaySystem().getRenderer().createAlphaState();
as.setEnabled(true);
as.setBlendEnabled(true);
as.setSrcFunction(AlphaState.SB_SRC_ALPHA);
as.setDstFunction(AlphaState.DB_ONE_MINUS_SRC_ALPHA);
as.setReference(0.0f);
as.setTestEnabled(true);
as.setTestFunction(AlphaState.TF_GEQUAL);
tree.setRenderState(as);

Thnaks alot for that

i have applied the texture to the planes of my model using 3ds max, so when my game runs will the white parts on the plane be ignored??

ok, im having problems with my models, the textures on the tree are non-existant, i have created the tree and put textures on them using 3ds max, but in the game the tree is white, the textures are in the same file as the model etc. also when i want to apply a texture to a model im my code the detail is lost and all i get is just the colour of the texture, how can i fix these problems?



thanks