Changeset 346

Show
Ignore:
Timestamp:
10/21/06 14:06:57 (2 years ago)
Author:
dshipton
Message:

Updated rudimentary numbers..

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/Dirk_RenderTraversalWork/Source/System/Action/RenderTraversal/OSGScreenLOD.inl

    r325 r346  
    5252     
    5353    Int32           index     = 0; 
     54 
    5455    if(numLevels > 1) 
    5556    { 
     
    9798        min[0] = osgClamp(-1.f, min[0], 1.f); 
    9899        min[1] = osgClamp(-1.f, min[1], 1.f); 
    99         //std::cout << min << std::endl; 
    100         //std::cout << max << std::endl; 
    101         //v.transform(worldToCam); 
    102          
    103         //Real32 pix = (max[0] - min[0]) * (max[1] - min[1]) * ((pix_width/2.0f)*(pix_height/2.0f)); 
    104         //Real32 cbb = pix / (pix_width * pix_height); 
    105100         
    106101        // cbb is the percent of the screen real estate this would cover 
     
    108103        Real32 pix = cbb * vp->getPixelWidth() * vp->getPixelHeight(); 
    109104 
    110         //std::cout << pix << std::endl; 
    111         //Make a choice based on pixels 
    112         if(pix < 1500) 
     105        //Make a choice based on percentage of pixels 
     106        if(cbb < 0.05) 
    113107            index++; 
    114         else if(pix < 500) 
     108        else if(cbb < 0.01) 
     109            index++; 
     110        else if(cbb < 0.001) 
    115111            index++; 
    116112        else if(pix < 50) 
     
    118114        else if(pix < 5) 
    119115            index=numLevels-1; 
     116 
     117        if (index >= numLevels) 
     118            index=numLevels-1; 
    120119    } 
    121  
    122     if (index >= numLevels) 
    123         index=numLevels-1; 
    124120 
    125121    ra->useNodeList();