HOW to realize Lod in PagedGeometry

sunrisefe

11-03-2009 02:49:33

From the help doc of PagedGeometry, we know when we use PagedGeometry's func addDetailLevel we will realize the LOD of trees. For example:
//Create and configure a new PagedGeometry instance
trees = new PagedGeometry();
trees->setCamera(camera); //Set the camera so PagedGeometry knows how to calculate LODs
trees->setPageSize(80); //Set the size of each page of geometry
trees->setInfinite(); //Use infinite paging mode
trees->addDetailLevel<BatchPage>(150, 50); //Use batches up to 150 units away, and fade for 30 more units
trees->addDetailLevel<ImpostorPage>(500, 50); //Use impostors up to 400 units, and for for 50 more units

then if //Load a tree entity
Entity *myEntity = sceneMgr->createEntity("Tree", "tree2.mesh");
, the scene will display trees with LOD? But we only appoint one mesh "tree2.mesh". Does PagedGeometry auto generate trees of different LOD from "tree2.mesh" according to the viewpoint distance?

Cutter

16-03-2009 02:00:17

You don`t need the entity lods because PagedGeometry generates impostors for you. I don`t think that even if only using BatchPage the reduced PolyCount would really make a difference on modern GPUs.