LuRenJia
06-11-2006 16:04:11
I created several BillboardSet to render trees, but have some strange problems.
1. the billboards don't face camera around Y axis, in fact they don't rotate.
2. the textures of the billboards are not transparent, they have a black background. (.Tga file have a right alpha channel).
any idea? sorry for trouble you again!
1. the billboards don't face camera around Y axis, in fact they don't rotate.
foreach(PlantsDesc pd in osmLoader.Plants)
{
List<Vector3> posList = GetTreePositions(pd.DataFile);
if (posList.Count <= 0)
continue;
BillboardSet bs = sceneMgr.CreateBillboardSet(pd.Material, (uint)posList.Count);
//bs.BillboardOrigin = BillboardOrigin.BBO_BOTTOM_CENTER;
//bs.BillboardRotationType = BillboardRotationType.BBR_VERTEX;
//bs.BillboardType = BillboardType.BBT_ORIENTED_COMMON;
bs.DefaultWidth = pd.TreeSize.Width;
bs.DefaultHeight = pd.TreeSize.Height;
bs.MaterialName = pd.Material;
//bs.Technique.SetSceneBlending(SceneBlendType.SBT_TRANSPARENT_ALPHA);
foreach (Vector3 v in posList)
bs.CreateBillboard(v);
//sceneMgr.RootSceneNode.CreateChildSceneNode(pd.Material + "_node").AttachObject(bs);
sceneMgr.RootSceneNode.AttachObject(bs);
}
2. the textures of the billboards are not transparent, they have a black background. (.Tga file have a right alpha channel).
material Material_#95124282
{
technique
{
pass
{
lighting off
scene_blend alpha_blend
depth_write off
texture_unit
{
texture_alias 0
texture tree01.tga
}
}
}
}
any idea? sorry for trouble you again!