Changeset 1663 for GTP


Ignore:
Timestamp:
10/22/06 17:35:23 (18 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis/Preprocessing
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/scripts/vsposp_typical.sh

    r1662 r1663  
    1212 
    1313#SCENE=vsposp_typical 
    14 #SCENE=soda5_vsposp 
    15 SCENE=soda_vsposp 
     14SCENE=soda5_vsposp 
     15#SCENE=soda_vsposp 
    1616#SCENE=vienna_vsposp 
    1717#SCENE=arena_vsposp 
     
    6464 echo "$SCENE $METHOD" 
    6565 
    66   $PROGRAM $ENVIRONMENT \ 
     66#  $PROGRAM $ENVIRONMENT \ 
    6767  -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \ 
    6868  -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \ 
     
    8484  echo "$SCENE $METHOD" 
    8585 
    86  $PROGRAM $ENVIRONMENT \ 
     86# $PROGRAM $ENVIRONMENT \ 
    8787  -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \ 
    8888  -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \ 
     
    102102  echo "$SCENE $METHOD" 
    103103 
    104  $PROGRAM $ENVIRONMENT \ 
     104# $PROGRAM $ENVIRONMENT \ 
    105105  -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \ 
    106106  -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \ 
     
    138138echo "$SCENE $METHOD" 
    139139 
    140 $PROGRAM $ENVIRONMENT \ 
     140#$PROGRAM $ENVIRONMENT \ 
    141141 -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \ 
    142142 -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \ 
     
    153153############################################################### 
    154154 
    155 # METHOD=gradient-multi 
    156 # echo "$SCENE $METHOD" 
     155 METHOD=gradient-multi 
     156 echo ********" $SCENE $METHOD ************" 
    157157 
    158 # $PROGRAM $ENVIRONMENT \ 
    159 # -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \ 
    160 # -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \ 
    161 # -vsp_subdivision_stats=$LOG_PREFIX-$METHOD-vsp-subdivisionStats.log \ 
    162  #-bvh_subdivision_stats=$LOG_PREFIX-$METHOD-bvh-subdivisionStats.log \ 
    163 # -hierarchy_subdivision_stats=$LOG_PREFIX-$METHOD-hierarchy-subdivisionStats.log \ 
    164 # -hierarchy_construction_type=2 \ 
    165 # -hierarchy_construction_multilevel=true \ 
    166 # -hierarchy_construction_levels=4 \ 
    167 # -hierarchy_construction_recompute_split_on_repair=true 
     158 $PROGRAM $ENVIRONMENT \ 
     159 -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \ 
     160 -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \ 
     161 -vsp_subdivision_stats=$LOG_PREFIX-$METHOD-vsp-subdivisionStats.log \ 
     162 -bvh_subdivision_stats=$LOG_PREFIX-$METHOD-bvh-subdivisionStats.log \ 
     163 -hierarchy_subdivision_stats=$LOG_PREFIX-$METHOD-hierarchy-subdivisionStats.log \ 
     164 -hierarchy_construction_type=2 \ 
     165 -hierarchy_construction_multilevel=true \ 
     166 -hierarchy_construction_levels=4 \ 
     167 -bvh_construction_render_cost_decrease_weight=0.6 \ 
     168 -vsp_construction_render_cost_decrease_weight=0.6 \ 
     169 -hierarchy_construction_recompute_split_on_repair=true 
    168170 
    169171sh movefiles.sh $LOG_PREFIX-$METHOD 
     
    173175 echo "$SCENE $METHOD" 
    174176 
    175   $PROGRAM $ENVIRONMENT \ 
     177#  $PROGRAM $ENVIRONMENT \ 
    176178  -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \ 
    177179  -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \ 
  • GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp

    r1662 r1663  
    2828#define USE_VOLUMES_FOR_HEURISTICS 1 
    2929 
     30#define CONSIDER_MEMORY 1 
    3031 
    3132int BvhNode::sMailId = 10000; //2147483647; 
     
    502503        const bool maxCostRatioViolated = mTermMaxCostRatio < ratio; 
    503504 
     505        const int previousMisses = splitCandidate.mParentData.mMaxCostMisses; 
     506 
    504507        splitCandidate.SetMaxCostMisses(maxCostRatioViolated ?  
    505                 splitCandidate.mParentData.mMaxCostMisses + 1 : 
    506                 splitCandidate.mParentData.mMaxCostMisses); 
     508                previousMisses + 1 : previousMisses); 
    507509 
    508510        const float oldProp = EvalViewCellsVolume(leaf->mObjects); 
     
    516518        const float renderCostDecr = oldRenderCost - newRenderCost; 
    517519         
     520        splitCandidate.SetRenderCostDecrease(renderCostDecr); 
     521 
     522        // increase in pvs entries 
     523        const int pvsEntriesIncr = EvalPvsEntriesIncr(splitCandidate); 
     524        splitCandidate.SetPvsEntriesIncr(pvsEntriesIncr); 
     525 
    518526#ifdef _DEBUG 
    519527        Debug << "old render cost: " << oldRenderCost << endl; 
     
    539547        else 
    540548        { 
     549                const float factor = mRenderCostDecreaseWeight; 
     550                 
    541551                // take render cost of node into account  
    542552                // otherwise danger of being stuck in a local minimum!! 
    543                 priority = mRenderCostDecreaseWeight * renderCostDecr +  
    544                                    (1.0f - mRenderCostDecreaseWeight) * oldRenderCost; 
     553                #if CONSIDER_MEMORY 
     554                        const float priority = factor * renderCostDecr - (1.0f - factor) * splitCandidate.GetPvsEntriesIncr(); 
     555                #else 
     556                        const float priority = factor * renderCostDecr + (1.0f - factor) * oldRenderCost; 
     557                #endif 
    545558        } 
    546559 
     
    548561        const float priority = (float)-splitCandidate.mParentData.mDepth; 
    549562#endif 
    550  
    551         splitCandidate.SetRenderCostDecrease(renderCostDecr); 
    552  
    553         // increase in pvs entries 
    554         const int pvsEntriesIncr = EvalPvsEntriesIncr(splitCandidate); 
    555         splitCandidate.SetPvsEntriesIncr(pvsEntriesIncr); 
    556563 
    557564        // compute global decrease in render cost 
     
    583590        // otherwise danger of being stuck in a local minimum!! 
    584591        const float factor = mRenderCostDecreaseWeight; 
     592        // $$ matt temp 
     593#if CONSIDER_MEMORY 
     594        const float priority = factor * renderCostDecr - (1.0f - factor) * splitCandidate.GetPvsEntriesIncr(); 
     595#else 
    585596        const float priority = factor * renderCostDecr + (1.0f - factor) * oldRenderCost; 
     597#endif 
    586598#else 
    587599        const float priority = (float)-splitCandidate.mParentData.mDepth; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.h

    r1662 r1663  
    406406                { 
    407407                        if (computeSplitplane) 
     408                        { 
    408409                                sBvHierarchy->EvalSubdivisionCandidate(*this);   
     410                        } 
    409411                        else 
     412                        { 
     413                                mPvsEntriesIncr = sBvHierarchy->EvalPvsEntriesIncr(*this); 
    410414                                mPriority = sBvHierarchy->EvalPriority(*this); 
     415                        } 
    411416                } 
    412417 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp

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

    r1662 r1663  
    790790 
    791791 
     792int HierarchyManager::GetObjectSpaceSubdivisionNodes() const 
     793{ 
     794        int maxLeaves = 0; 
     795 
     796        if (mObjectSpaceSubdivisionType == KD_BASED_OBJ_SUBDIV) 
     797        { 
     798                maxLeaves = mOspTree->mOspStats.nodes; 
     799        } 
     800        else if (mObjectSpaceSubdivisionType == BV_BASED_OBJ_SUBDIV) 
     801        { 
     802                maxLeaves = mBvHierarchy->mBvhStats.nodes; 
     803        } 
     804 
     805        return maxLeaves; 
     806} 
     807 
    792808bool HierarchyManager::StartObjectSpaceSubdivision() const 
    793809{ 
     
    954970                        cout << "\nreseting bv hierarchy" << endl; 
    955971                        Debug << "old bv hierarchy:\n " << mBvHierarchy->mBvhStats << endl; 
     972                                 
     973                        // rather use this: remove previous nodes and add the two new ones 
     974                        //mHierarchyStats.mNodes -= mBvHierarchy->mBvhStats.nodes + 1; 
     975                        mHierarchyStats.mNodes = mVspTree->mVspStats.nodes; 
    956976                         
     977                        // create root 
    957978                        mBvHierarchy->Initialise(objects); 
    958979         
    959                         // rather use this: remove previous nodes and add the two new ones 
    960                         mHierarchyStats.mNodes -= mBvHierarchy->mBvhStats.nodes + 1; 
     980                        firstCandidate = mBvHierarchy->Reset(sampleRays, objects); 
     981 
     982                        mHierarchyStats.mTotalCost = mBvHierarchy->mTotalCost; 
    961983                         
    962                         firstCandidate = mBvHierarchy->Reset(sampleRays, objects); 
    963  
    964                         mHierarchyStats.mTotalCost = mBvHierarchy->mTotalCost; 
    965984                        //mHierarchyStats.mPvsEntries -= mBvHierarchy->mPvsEntries + 1; 
    966985                        mHierarchyStats.mPvsEntries = mBvHierarchy->CountViewCells(objects); 
     986 
    967987                        mHierarchyStats.mMemory = mHierarchyStats.mPvsEntries * 
    968988                                sizeof(PvsData) + sizeof(Intersectable *) / (1024.0f * 1024.0f); 
     
    10031023         
    10041024        //-- reset stats 
    1005     mHierarchyStats.mNodes = -mVspTree->mVspStats.nodes + 1; 
     1025    mHierarchyStats.mNodes = GetObjectSpaceSubdivisionNodes();//-mVspTree->mVspStats.nodes + 1; 
    10061026         
    10071027        SubdivisionCandidate *vsc = PrepareViewSpaceSubdivision(sampleRays, objects); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h

    r1662 r1663  
    387387        */ 
    388388        int GetObjectSpaceSubdivisionLeaves() const; 
     389        int GetObjectSpaceSubdivisionNodes() const; 
    389390 
    390391        /** Construct object space partition interleaved with view space partition. 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp

    r1662 r1663  
    2828 
    2929#define USE_FIXEDPOINT_T 0 
    30  
     30#define CONSIDER_MEMORY 1 
    3131 
    3232///////////// 
     
    825825        // otherwise danger of being stuck in a local minimum!! 
    826826        const float factor = mRenderCostDecreaseWeight; 
     827 
     828#if CONSIDER_MEMORY 
     829        const float priority = factor * renderCostDecr - (1.0f - factor) * splitCandidate.GetPvsEntriesIncr(); 
     830#else 
    827831        const float priority = factor * renderCostDecr + (1.0f - factor) * oldRenderCost; 
     832#endif 
    828833#endif 
    829834         
     
    846851        // otherwise danger of being stuck in a local minimum!! 
    847852        const float factor = mRenderCostDecreaseWeight; 
     853#if CONSIDER_MEMORY 
     854        const float priority = factor * renderCostDecr - (1.0f - factor) * splitCandidate.GetPvsEntriesIncr(); 
     855#else 
    848856        const float priority = factor * renderCostDecr + (1.0f - factor) * oldRenderCost; 
     857#endif 
     858 
    849859#endif 
    850860         
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.h

    r1662 r1663  
    462462                                sVspTree->EvalSubdivisionCandidate(*this);       
    463463                        else 
     464                        { 
     465                                mPvsEntriesIncr = sVspTree->EvalPvsEntriesIncr(*this); 
    464466                                mPriority = sVspTree->EvalPriority(*this); 
     467                        } 
    465468                } 
    466469 
Note: See TracChangeset for help on using the changeset viewer.