Changeset 1665 for GTP


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

improved ratio method for vsposp subdivision

Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
3 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} 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp

    r1663 r1665  
    21712171                                optFloat, 
    21722172                                "vsp_construction_render_cost_decrease_weight=", 
    2173                                 "1.0"); 
     2173                                "0.99"); 
    21742174 
    21752175        RegisterOption("VspTree.Termination.maxDepth", 
     
    24592459                                   optFloat, 
    24602460                                   "bvh_construction_render_cost_decrease_weight=", 
    2461                                    "1.0"); 
     2461                                   "0.99"); 
    24622462         
    24632463        RegisterOption("BvHierarchy.Construction.useGlobalSorting", 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp

    r1664 r1665  
    822822        const float factor = mRenderCostDecreaseWeight; 
    823823 
    824         float priority; 
     824        float priority = factor * renderCostDecr + (1.0f - factor) * oldRenderCost; 
    825825 
    826826        if (mHierarchyManager->mConsiderMemory) 
     
    828828                //cout << "here4 rc: " << factor * renderCostDecr << " pvs: " << (1.0f - factor) * splitCandidate.GetPvsEntriesIncr() << endl; 
    829829                //const float priority = factor * renderCostDecr - (1.0f - factor) * splitCandidate.GetPvsEntriesIncr(); 
    830                 priority = renderCostDecr / ((float)splitCandidate.GetPvsEntriesIncr() +  + 1.0f); 
    831         } 
    832         else 
    833         { 
    834                 priority = factor * renderCostDecr + (1.0f - factor) * oldRenderCost; 
     830                priority /= ((float)splitCandidate.GetPvsEntriesIncr() +  + 1.0f); 
    835831        } 
    836832         
     
    851847        const float factor = mRenderCostDecreaseWeight; 
    852848 
    853         float priority; 
     849        float priority = factor * renderCostDecr + (1.0f - factor) * oldRenderCost; 
    854850 
    855851        if (mHierarchyManager->mConsiderMemory) 
     
    857853                //cout << "here2 rc: " << factor * renderCostDecr << " pvs: " << (1.0f - factor) * splitCandidate.GetPvsEntriesIncr() << endl;  
    858854                //const float priority = factor * renderCostDecr - (1.0f - factor) * splitCandidate.GetPvsEntriesIncr(); 
    859                 priority = renderCostDecr / ((float)splitCandidate.GetPvsEntriesIncr() + 1.0f); 
    860         } 
    861         else 
    862         { 
    863                 priority = factor * renderCostDecr + (1.0f - factor) * oldRenderCost; 
     855                priority /= ((float)splitCandidate.GetPvsEntriesIncr() + 1.0f); 
    864856        } 
    865857 
Note: See TracChangeset for help on using the changeset viewer.