Show
Ignore:
Timestamp:
11/01/06 16:31:27 (2 years ago)
Author:
dshipton
Message:

Factor added for controlling degradation for users, so a user can make the degradation happen slower/faster.
Added to testOcclusionCulling as d/D: the bigger the factor, the faster the LOD switching happens when it hits the threshold.

Files:

Legend:

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

    r376 r377  
    126126 
    127127            // Find out what the average degradation of triangles is each level 
    128             Real32 deg_percent = (st_min->getTriangles() / st_max->getTriangles()) * (numLevels-1); 
     128            Real32 deg_percent = 1.0 - (st_min->getTriangles() / st_max->getTriangles()); 
     129            deg_percent = deg_percent / numLevels; 
    129130            if(deg_percent >= 1.0) 
    130131            { 
     
    133134 
    134135            Real32 base_percent = ra->getScreenLODCoverageThreshold(); //Above this renders at full res! 
    135  
     136            Real32 user_deg_factor = ra->getScreenLODDegradationFactor(); 
    136137            // While the screen percentage of the object is less that the percent allowed for the current LOD 
    137138            // move down a LOD and find out the new allowed percentage 
    138139            while(cbb < base_percent) 
    139140            { 
    140                 base_percent*=deg_percent
     141                base_percent= base_percent * deg_percent * user_deg_factor
    141142                index++; 
    142143                if(index >= numLevels)