Author Topic: Leaves, Trees and Culling / Transparency in a Merged 3DS Level  (Read 4985 times)

Offline ToddMcF2002

  • long
  • ***
  • Posts: 103
    • View Profile
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.


Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Leaves, Trees and Culling / Transparency in a Merged 3DS Level
« Reply #1 on: May 15, 2007, 09:01:30 am »
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.

Offline ToddMcF2002

  • long
  • ***
  • Posts: 103
    • View Profile
Re: Leaves, Trees and Culling / Transparency in a Merged 3DS Level
« Reply #2 on: May 15, 2007, 12:30:03 pm »
I'm trying to figure out how to reasonably manage the leaves separately.  Algorithmic?


Offline Remo

  • int
  • **
  • Posts: 64
    • View Profile
    • http://www.opsdirector.com/3dart
Re: Leaves, Trees and Culling / Transparency in a Merged 3DS Level
« Reply #3 on: May 15, 2007, 12:51:17 pm »
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 :).

Offline ToddMcF2002

  • long
  • ***
  • Posts: 103
    • View Profile
Re: Leaves, Trees and Culling / Transparency in a Merged 3DS Level
« Reply #4 on: May 15, 2007, 01:10:15 pm »
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.

Offline ToddMcF2002

  • long
  • ***
  • Posts: 103
    • View Profile
Re: Leaves, Trees and Culling / Transparency in a Merged 3DS Level
« Reply #5 on: May 16, 2007, 04:22:07 am »
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.