Ignore:
Timestamp:
10/23/06 10:38:44 (18 years ago)
Author:
mattausch
Message:

improved ratio method for vsposp subdivision

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp

    r1664 r1665  
    543543                const float factor = mRenderCostDecreaseWeight; 
    544544                 
     545                priority = factor * renderCostDecr + (1.0f - factor) * oldRenderCost; 
     546 
    545547                // take render cost of node into account  
    546548                // otherwise danger of being stuck in a local minimum!! 
     
    549551                        //cout << "here7 rc: " << factor * renderCostDecr << " pvs: " << (1.0f - factor) * splitCandidate.GetPvsEntriesIncr() << endl; 
    550552                        //priority = factor * renderCostDecr - (1.0f - factor) * splitCandidate.GetPvsEntriesIncr();// / mBvhStats.Leaves(); 
    551                         priority = renderCostDecr / ((float)splitCandidate.GetPvsEntriesIncr() + 1.0f); 
    552                 } 
    553                 else 
    554                 { 
    555                         priority = factor * renderCostDecr + (1.0f - factor) * oldRenderCost; 
     553                        priority /= ((float)splitCandidate.GetPvsEntriesIncr() + 1.0f); 
    556554                } 
    557555        } 
     
    584582        const float factor = mRenderCostDecreaseWeight; 
    585583         
    586         float priority; 
     584        float priority = factor * renderCostDecr + (1.0f - factor) * oldRenderCost; 
    587585 
    588586        // $$ matt temp 
     
    591589                //cout << "here5 rc: " << factor * renderCostDecr << " pvs: " << (1.0f - factor) * splitCandidate.GetPvsEntriesIncr() << endl; 
    592590                //const float priority = factor * renderCostDecr - (1.0f - factor) * (float)splitCandidate.GetPvsEntriesIncr(); 
    593                 priority = renderCostDecr / ((float)splitCandidate.GetPvsEntriesIncr() + 1.0f); 
    594         } 
    595         else 
    596         { 
    597                 priority = factor * renderCostDecr + (1.0f - factor) * oldRenderCost; 
    598         } 
    599  
     591                priority /= ((float)splitCandidate.GetPvsEntriesIncr() + 1.0f); 
     592        } 
     593         
    600594        return priority; 
    601595} 
Note: See TracChangeset for help on using the changeset viewer.