- Timestamp:
- 10/22/06 17:35:23 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/scripts/vsposp_typical.sh
r1662 r1663 12 12 13 13 #SCENE=vsposp_typical 14 #SCENE=soda5_vsposp15 SCENE=soda_vsposp14 SCENE=soda5_vsposp 15 #SCENE=soda_vsposp 16 16 #SCENE=vienna_vsposp 17 17 #SCENE=arena_vsposp … … 64 64 echo "$SCENE $METHOD" 65 65 66 $PROGRAM $ENVIRONMENT \66 # $PROGRAM $ENVIRONMENT \ 67 67 -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \ 68 68 -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \ … … 84 84 echo "$SCENE $METHOD" 85 85 86 $PROGRAM $ENVIRONMENT \86 # $PROGRAM $ENVIRONMENT \ 87 87 -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \ 88 88 -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \ … … 102 102 echo "$SCENE $METHOD" 103 103 104 $PROGRAM $ENVIRONMENT \104 # $PROGRAM $ENVIRONMENT \ 105 105 -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \ 106 106 -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \ … … 138 138 echo "$SCENE $METHOD" 139 139 140 $PROGRAM $ENVIRONMENT \140 #$PROGRAM $ENVIRONMENT \ 141 141 -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \ 142 142 -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \ … … 153 153 ############################################################### 154 154 155 #METHOD=gradient-multi156 # echo "$SCENE $METHOD"155 METHOD=gradient-multi 156 echo ********" $SCENE $METHOD ************" 157 157 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 168 170 169 171 sh movefiles.sh $LOG_PREFIX-$METHOD … … 173 175 echo "$SCENE $METHOD" 174 176 175 $PROGRAM $ENVIRONMENT \177 # $PROGRAM $ENVIRONMENT \ 176 178 -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \ 177 179 -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \ -
GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
r1662 r1663 28 28 #define USE_VOLUMES_FOR_HEURISTICS 1 29 29 30 #define CONSIDER_MEMORY 1 30 31 31 32 int BvhNode::sMailId = 10000; //2147483647; … … 502 503 const bool maxCostRatioViolated = mTermMaxCostRatio < ratio; 503 504 505 const int previousMisses = splitCandidate.mParentData.mMaxCostMisses; 506 504 507 splitCandidate.SetMaxCostMisses(maxCostRatioViolated ? 505 splitCandidate.mParentData.mMaxCostMisses + 1 : 506 splitCandidate.mParentData.mMaxCostMisses); 508 previousMisses + 1 : previousMisses); 507 509 508 510 const float oldProp = EvalViewCellsVolume(leaf->mObjects); … … 516 518 const float renderCostDecr = oldRenderCost - newRenderCost; 517 519 520 splitCandidate.SetRenderCostDecrease(renderCostDecr); 521 522 // increase in pvs entries 523 const int pvsEntriesIncr = EvalPvsEntriesIncr(splitCandidate); 524 splitCandidate.SetPvsEntriesIncr(pvsEntriesIncr); 525 518 526 #ifdef _DEBUG 519 527 Debug << "old render cost: " << oldRenderCost << endl; … … 539 547 else 540 548 { 549 const float factor = mRenderCostDecreaseWeight; 550 541 551 // take render cost of node into account 542 552 // 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 545 558 } 546 559 … … 548 561 const float priority = (float)-splitCandidate.mParentData.mDepth; 549 562 #endif 550 551 splitCandidate.SetRenderCostDecrease(renderCostDecr);552 553 // increase in pvs entries554 const int pvsEntriesIncr = EvalPvsEntriesIncr(splitCandidate);555 splitCandidate.SetPvsEntriesIncr(pvsEntriesIncr);556 563 557 564 // compute global decrease in render cost … … 583 590 // otherwise danger of being stuck in a local minimum!! 584 591 const float factor = mRenderCostDecreaseWeight; 592 // $$ matt temp 593 #if CONSIDER_MEMORY 594 const float priority = factor * renderCostDecr - (1.0f - factor) * splitCandidate.GetPvsEntriesIncr(); 595 #else 585 596 const float priority = factor * renderCostDecr + (1.0f - factor) * oldRenderCost; 597 #endif 586 598 #else 587 599 const float priority = (float)-splitCandidate.mParentData.mDepth; -
GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.h
r1662 r1663 406 406 { 407 407 if (computeSplitplane) 408 { 408 409 sBvHierarchy->EvalSubdivisionCandidate(*this); 410 } 409 411 else 412 { 413 mPvsEntriesIncr = sBvHierarchy->EvalPvsEntriesIncr(*this); 410 414 mPriority = sBvHierarchy->EvalPriority(*this); 415 } 411 416 } 412 417 -
GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp
r1662 r1663 2171 2171 optFloat, 2172 2172 "vsp_construction_render_cost_decrease_weight=", 2173 " 0.99");2173 "1.0"); 2174 2174 2175 2175 RegisterOption("VspTree.Termination.maxDepth", … … 2459 2459 optFloat, 2460 2460 "bvh_construction_render_cost_decrease_weight=", 2461 " 0.99");2461 "1.0"); 2462 2462 2463 2463 RegisterOption("BvHierarchy.Construction.useGlobalSorting", -
GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp
r1662 r1663 790 790 791 791 792 int 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 792 808 bool HierarchyManager::StartObjectSpaceSubdivision() const 793 809 { … … 954 970 cout << "\nreseting bv hierarchy" << endl; 955 971 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; 956 976 977 // create root 957 978 mBvHierarchy->Initialise(objects); 958 979 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; 961 983 962 firstCandidate = mBvHierarchy->Reset(sampleRays, objects);963 964 mHierarchyStats.mTotalCost = mBvHierarchy->mTotalCost;965 984 //mHierarchyStats.mPvsEntries -= mBvHierarchy->mPvsEntries + 1; 966 985 mHierarchyStats.mPvsEntries = mBvHierarchy->CountViewCells(objects); 986 967 987 mHierarchyStats.mMemory = mHierarchyStats.mPvsEntries * 968 988 sizeof(PvsData) + sizeof(Intersectable *) / (1024.0f * 1024.0f); … … 1003 1023 1004 1024 //-- reset stats 1005 mHierarchyStats.mNodes = -mVspTree->mVspStats.nodes + 1;1025 mHierarchyStats.mNodes = GetObjectSpaceSubdivisionNodes();//-mVspTree->mVspStats.nodes + 1; 1006 1026 1007 1027 SubdivisionCandidate *vsc = PrepareViewSpaceSubdivision(sampleRays, objects); -
GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h
r1662 r1663 387 387 */ 388 388 int GetObjectSpaceSubdivisionLeaves() const; 389 int GetObjectSpaceSubdivisionNodes() const; 389 390 390 391 /** Construct object space partition interleaved with view space partition. -
GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp
r1662 r1663 28 28 29 29 #define USE_FIXEDPOINT_T 0 30 30 #define CONSIDER_MEMORY 1 31 31 32 32 ///////////// … … 825 825 // otherwise danger of being stuck in a local minimum!! 826 826 const float factor = mRenderCostDecreaseWeight; 827 828 #if CONSIDER_MEMORY 829 const float priority = factor * renderCostDecr - (1.0f - factor) * splitCandidate.GetPvsEntriesIncr(); 830 #else 827 831 const float priority = factor * renderCostDecr + (1.0f - factor) * oldRenderCost; 832 #endif 828 833 #endif 829 834 … … 846 851 // otherwise danger of being stuck in a local minimum!! 847 852 const float factor = mRenderCostDecreaseWeight; 853 #if CONSIDER_MEMORY 854 const float priority = factor * renderCostDecr - (1.0f - factor) * splitCandidate.GetPvsEntriesIncr(); 855 #else 848 856 const float priority = factor * renderCostDecr + (1.0f - factor) * oldRenderCost; 857 #endif 858 849 859 #endif 850 860 -
GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.h
r1662 r1663 462 462 sVspTree->EvalSubdivisionCandidate(*this); 463 463 else 464 { 465 mPvsEntriesIncr = sVspTree->EvalPvsEntriesIncr(*this); 464 466 mPriority = sVspTree->EvalPriority(*this); 467 } 465 468 } 466 469
Note: See TracChangeset
for help on using the changeset viewer.