Leaves, Trees and Culling / Transparency in a Merged 3DS Level

Started by ToddMcF2002, May 15, 2007, 05:30:40 AM

Previous topic - Next topic

ToddMcF2002

I started a tree and before positioning a 100 or so leaf clusters I decided (smartly!) to give it a whirl in JPCT and of course I've got a new issue now  ;D

Leaf transparency and culling.  I don't want to set the whole merged terrain to CULLING_DISABLED and setTransparency(X).

So how do I solve this issue with compound objects like this?  Do I need to load all trees seperately from the level or use a custom XML loader to generate the leaves for the tree on the fly using Object3D primatives?  Here is pic of my problem - the first leaf cluster lacks the appropriate transparency and culling properties.


EgonOlsen

Transparency and culling work per object. You can't merge a transparent object to a non-transparent and maintain the transparency. Such meshes need to be seperate objects. I suggest simply not to merge the trees into the level or (even better) merge the tree but keep the leaves separate if possible.

ToddMcF2002

I'm trying to figure out how to reasonably manage the leaves separately.  Algorithmic?


Remo

If your leafs are prepositioned you can just separate the models by deleting the tree from the leafs and the leafs from the tree. If not you will need an algorithm :).

ToddMcF2002

Yeah I think I want to end up with two meshes - the tree (1) and the leaves as a collective canopy (2).  Technically the canopy parts don't have to even touch to be in the same mesh.  That will make the JPCT rotation easier and I can manage the culling and transparency seperate from the trunk.

ToddMcF2002

Tree fixed.  For right now its using transparency and culling on the entire object which is pretty bad.  I think I need to write a developers kit soon so I can place objects on the terrain and record all the vector offsets and load from XML.  The convenient "mergeObjects" is just going to continue to cause problems especially for mover objects (thinking in old Unreal 1 terms)....

I'll update the project page with this shot - its all going to move pretty fast now.