Changeset 2350 for GTP/trunk/Lib/Vis/Preprocessing
- Timestamp:
- 05/03/07 23:23:31 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/scripts/gi_final.env
r2255 r2350 173 173 } 174 174 175 #showVisualization true176 showVisualization false175 showVisualization true 176 #showVisualization false 177 177 #evaluateViewCells false 178 178 evaluateViewCells true 179 179 180 180 Evaluation { 181 samples 100000000 182 samplesForStats 100000000 183 #samples 10000000 184 #samplesForStats 10000000 181 samples 6000000 182 samplesForStats 2000000 185 183 186 184 samplesPerPass 500000 … … 233 231 Construction { 234 232 renderCostDecreaseWeight 0.999 233 # renderCostDecreaseWeight 1.0 235 234 } 236 235 … … 265 264 Construction { 266 265 267 samples 6000000266 samples 100000 268 267 269 268 # type 0 = sequential computation, 1 = interleaved, 2 = gradient … … 280 279 # minimal steps of same type: for interleaved, this is only valid for the first few splits 281 280 minStepsOfSameType 100 282 #maxStepsOfSameType 3000283 281 maxStepsOfSameType 900 284 282 … … 288 286 Termination { 289 287 # maximal number of leaves 290 maxLeaves 300000 291 # maxLeaves 6000 288 maxLeaves 10000 292 289 # maximal memory in MB 293 290 # maxMemory 4 294 maxMemory 35291 maxMemory 25 295 292 # minimum ratio of global cost decrease 296 293 minGlobalCostRatio -1 -
GTP/trunk/Lib/Vis/Preprocessing/scripts/gi_final.sh
r2309 r2350 7 7 TARGET=release 8 8 9 PROGRAM=../bin/$TARGET/Preprocessor.exe 9 PROGRAM=../bin/$TARGET/Preprocessor2.exe 10 #PROGRAM=../bin/$TARGET/Preprocessor_old.exe 11 #PROGRAM=../bin/$TARGET/Preprocessor_itl.exe 10 12 11 13 EXT=obj 12 #SCENE=vienna_cropped13 #SCENE_PATH=../data/vienna14 SCENE=vienna_cropped 15 SCENE_PATH=../data/vienna 14 16 15 17 #SCENE=arena-high-lods 16 18 #SCENE_PATH=../data/Arena 17 19 18 SCENE= PompeiiOne19 SCENE_PATH=../data/ Pompeii20 SCENE=soda 21 SCENE_PATH=../data/soda 20 22 21 23 ENVIRONMENT=gi_final.env 22 23 LOG_PREFIX=../scripts/tests/gi/$SCENE-speed 24 LOG_PREFIX=../scripts/tests/gi/$SCENE-test 24 25 25 26 echo "starting $TARGET mode for $SCENE scene ($PROGRAM)" … … 29 30 ####################################################### 30 31 31 USE_HEUR=true 32 METHOD=int 33 echo "$SCENE $METHOD" 32 USE_HEUR=false 33 METHOD=int-$USE_HEUR 34 34 35 35 echo "$SCENE $METHOD" 36 36 $PROGRAM $ENVIRONMENT \ 37 37 -scene_filename=$SCENE_FILENAME \ … … 40 40 -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \ 41 41 -view_cells_filename=$LOG_PREFIX-$METHOD-viewcells.xml.gz \ 42 -view_cells_triangle_weight=1.0 \ 43 -view_cells_object_weight=0.0 \ 42 44 -vsp_subdivision_stats=$LOG_PREFIX-$METHOD-vsp-subdivisionStats.log \ 43 45 -bvh_subdivision_stats=$LOG_PREFIX-$METHOD-bvh-subdivisionStats.log \ … … 46 48 -hierarchy_construction_min_avg_rays_per_object=0 \ 47 49 -hierarchy_construction_max_avg_rays_per_object=0 \ 48 -bvh_use_sah= false \50 -bvh_use_sah=true \ 49 51 -vsp_use_cost_heuristics=$USE_HEUR 50 52 51 53 sh movefiles.sh $LOG_PREFIX-$METHOD 52 54 53 #######################################################54 55 55 USE_HEUR=true56 METHOD=int-257 echo "$SCENE $METHOD"58 59 60 $PROGRAM $ENVIRONMENT \61 -scene_filename=$SCENE_FILENAME \62 -view_cells_sampling_type=object_directional \63 -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \64 -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \65 -view_cells_filename=$LOG_PREFIX-$METHOD-viewcells.xml.gz \66 -vsp_subdivision_stats=$LOG_PREFIX-$METHOD-vsp-subdivisionStats.log \67 -bvh_subdivision_stats=$LOG_PREFIX-$METHOD-bvh-subdivisionStats.log \68 -hierarchy_subdivision_stats=$LOG_PREFIX-$METHOD-hierarchy-subdivisionStats.log \69 -hierarchy_construction_type=2 \70 -hierarchy_construction_min_avg_rays_per_object=1 \71 -hierarchy_construction_max_avg_rays_per_object=10 \72 -bvh_use_sah=false \73 -vsp_use_cost_heuristics=$USE_HEUR74 75 sh movefiles.sh $LOG_PREFIX-$METHOD76 56 77 57 ####################################################### 78 58 79 59 NODES=60000 80 #NODES=5000 81 USE_HEUR=true 82 #USE_HEUR=false 83 84 METHOD=seq-$NODES 85 echo "$SCENE $METHOD" 60 USE_HEUR=false 61 METHOD=seq-$NODES-$USE_HEUR 62 63 #echo "$SCENE $METHOD" 64 # $PROGRAM $ENVIRONMENT \ 65 -scene_filename=$SCENE_FILENAME \ 66 -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \ 67 -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \ 68 -view_cells_filename=$LOG_PREFIX-$METHOD-viewcells.xml.gz \ 69 -vsp_subdivision_stats=$LOG_PREFIX-$METHOD-vsp-subdivisionStats.log \ 70 -bvh_subdivision_stats=$LOG_PREFIX-$METHOD-bvh-subdivisionStats.log \ 71 -hierarchy_subdivision_stats=$LOG_PREFIX-$METHOD-hierarchy-subdivisionStats.log \ 72 -hierarchy_construction_type=0 \ 73 -view_cells_triangle_weight=1.0 \ 74 -view_cells_object_weight=50.0 \ 75 -vsp_use_cost_heuristics=$USE_HEUR \ 76 -bvh_term_max_leaves=$NODES 86 77 87 $PROGRAM $ENVIRONMENT \ 88 -scene_filename=$SCENE_FILENAME \ 89 -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \ 90 -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \ 91 -view_cells_filename=$LOG_PREFIX-$METHOD-viewcells.xml.gz \ 92 -vsp_subdivision_stats=$LOG_PREFIX-$METHOD-vsp-subdivisionStats.log \ 93 -bvh_subdivision_stats=$LOG_PREFIX-$METHOD-bvh-subdivisionStats.log \ 94 -hierarchy_subdivision_stats=$LOG_PREFIX-$METHOD-hierarchy-subdivisionStats.log \ 95 -hierarchy_construction_type=0 \ 96 -hierarchy_construction_consider_memory=false \ 97 -vsp_use_cost_heuristics=$USE_HEUR \ 98 -bvh_term_max_leaves=$NODES 78 #sh movefiles.sh $LOG_PREFIX-$METHOD 99 79 100 sh movefiles.sh $LOG_PREFIX-$METHOD101 102 103 #######################################################104 105 NODES=10000106 USE_HEUR=true107 #USE_HEUR=false108 109 METHOD=seq-$NODES110 echo "$SCENE $METHOD"111 112 $PROGRAM $ENVIRONMENT \113 -scene_filename=$SCENE_FILENAME \114 -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \115 -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \116 -view_cells_filename=$LOG_PREFIX-$METHOD-viewcells.xml.gz \117 -vsp_subdivision_stats=$LOG_PREFIX-$METHOD-vsp-subdivisionStats.log \118 -bvh_subdivision_stats=$LOG_PREFIX-$METHOD-bvh-subdivisionStats.log \119 -hierarchy_subdivision_stats=$LOG_PREFIX-$METHOD-hierarchy-subdivisionStats.log \120 -hierarchy_construction_type=0 \121 -hierarchy_construction_consider_memory=false \122 -vsp_use_cost_heuristics=$USE_HEUR \123 -bvh_term_max_leaves=$NODES124 125 sh movefiles.sh $LOG_PREFIX-$METHOD -
GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
r2347 r2350 693 693 AssociateViewCellsWithObjects(*tData.mSampledObjects); 694 694 695 EvalSubdivisionCandidate2(*frontCandidate, true, false);696 cout << "\nfc2: " << frontCandidate->GetPriority() << endl;697 695 EvalSubdivisionCandidate(*frontCandidate, true, false); 698 cout << "fc1: " << frontCandidate->GetPriority() << endl;699 696 EvalSubdivisionCandidate(*backCandidate, true, false); 700 697 … … 789 786 790 787 791 void BvHierarchy::EvalSubdivisionCandidate 2(BvhSubdivisionCandidate &splitCandidate,788 void BvHierarchy::EvalSubdivisionCandidate(BvhSubdivisionCandidate &splitCandidate, 792 789 const bool computeSplitPlane, 793 790 const bool preprocessViewCells) … … 890 887 } 891 888 892 //cout << "pvol: " << parentVol << " front: " << volFront << " back: " << volBack << " diff: " << parentVol - volFront - volBack << endl;893 894 889 895 890 ///////////////////// … … 936 931 const int backTri = (int)splitCandidate.mBackObjects.size(); 937 932 938 if (totalTri - frontTri - backTri != 0)939 cout << "big error!!!" << endl;940 933 941 934 // compute render cost decrease in the view cells which can see the object … … 980 973 oldRenderCost += oldRc * vc->GetVolume() / viewSpaceVol; 981 974 newRenderCost += newRc * vc->GetVolume() / viewSpaceVol; 982 //cout << "old rc=" << oldRenderCost << " new rc " << newRenderCost << endl; 983 } 984 985 986 const float dummyFrontVol = EvalViewCellsVolume(splitCandidate.mSampledFrontObjects) / viewSpaceVol; 987 const float dummyBackVol = EvalViewCellsVolume(splitCandidate.mSampledBackObjects) / viewSpaceVol; 988 const float dummyParentVol = EvalViewCellsVolume(leaf->mObjects) / viewSpaceVol; 989 990 const int dummyNumFrontViewCells = CountViewCells(splitCandidate.mSampledFrontObjects); 991 const int dummyNumBackViewCells = CountViewCells(splitCandidate.mSampledBackObjects); 992 const int dummyPvs = CountViewCells(*tData.mSampledObjects); 993 994 const int dummyPvsEntriesIncr = - dummyPvs + dummyNumFrontViewCells + dummyNumBackViewCells; 995 996 const float relfrontCost = dummyFrontVol * (float)splitCandidate.mFrontObjects.size(); 997 const float relBackCost = dummyBackVol * (float)splitCandidate.mBackObjects.size(); 998 const float relParentCost = dummyParentVol * (float)leaf->mObjects.size(); 999 1000 // compute global decrease in render cost 1001 const float dummyNewRenderCost = relfrontCost + relBackCost; 1002 const float dummyRenderCostDecr = relParentCost - dummyNewRenderCost; 1003 975 } 1004 976 1005 977 … … 1011 983 splitCandidate.SetRenderCostDecrease(renderCostDecr); 1012 984 1013 float pseudoOldRenderCost = parentVol * (float)leaf->mObjects.size() / viewSpaceVol; 1014 1015 //cout << "cor. entries: " << dummyPvsEntriesIncr << " entries: " << frontAndBackViewCells << endl; 1016 cout << "\nv1: " << renderCostDecr << " " << pseudoOldRenderCost << " " << newRenderCost << endl; 1017 cout << "v2: " << dummyRenderCostDecr << " " << relParentCost << " " << dummyNewRenderCost << endl; 985 const float pseudoOldRenderCost = parentVol * (float)leaf->mObjects.size() / viewSpaceVol; 1018 986 1019 987 // at last computed priority based on render cost reduction / memory increase 1020 988 const float priority = EvalPriority(splitCandidate, renderCostDecr, pseudoOldRenderCost); 1021 cout << "\nfc0: " << priority << endl;1022 const float priority2 = EvalPriority(splitCandidate, dummyRenderCostDecr, relParentCost);1023 splitCandidate.SetPriority(priority2);1024 1025 #if STORE_VIEWCELLS_WITH_BVH1026 if (preprocessViewCells)1027 ReleaseViewCells(*splitCandidate.mParentData.mSampledObjects);1028 #endif1029 1030 mEvalTimer.Exit();1031 }1032 1033 1034 void BvHierarchy::EvalSubdivisionCandidate(BvhSubdivisionCandidate &splitCandidate,1035 const bool computeSplitPlane,1036 const bool preprocessViewCells)1037 {1038 mPlaneTimer.Entry();1039 1040 #if STORE_VIEWCELLS_WITH_BVH1041 if (preprocessViewCells) // fill view cells cache1042 AssociateViewCellsWithObjects(*splitCandidate.mParentData.mSampledObjects);1043 #endif1044 1045 if (computeSplitPlane)1046 {1047 splitCandidate.mFrontObjects.clear();1048 splitCandidate.mBackObjects.clear();1049 splitCandidate.mSampledFrontObjects.clear();1050 splitCandidate.mSampledBackObjects.clear();1051 1052 const bool sufficientSamples =1053 splitCandidate.mParentData.mNumRays > mMinRaysForVisibility;1054 1055 //if (!sufficientSamples) cout << splitCandidate.mParentData.mNumRays << " ";1056 1057 const bool useVisibiliyBasedHeuristics =1058 !mUseSah &&1059 (mHierarchyManager->GetViewSpaceSubdivisionType() ==1060 HierarchyManager::KD_BASED_VIEWSPACE_SUBDIV) &&1061 sufficientSamples;1062 1063 // compute best object partition1064 const float ratio = SelectObjectPartition(splitCandidate.mParentData,1065 splitCandidate.mFrontObjects,1066 splitCandidate.mBackObjects,1067 useVisibiliyBasedHeuristics);1068 1069 // cost ratio violated?1070 const bool maxCostRatioViolated = mTermMaxCostRatio < ratio;1071 const int previousMisses = splitCandidate.mParentData.mMaxCostMisses;1072 1073 splitCandidate.SetMaxCostMisses(maxCostRatioViolated ?1074 previousMisses + 1 : previousMisses);1075 1076 StoreSampledObjects(splitCandidate.mSampledFrontObjects, splitCandidate.mFrontObjects);1077 StoreSampledObjects(splitCandidate.mSampledBackObjects, splitCandidate.mBackObjects);1078 }1079 1080 mPlaneTimer.Exit();1081 1082 mEvalTimer.Entry();1083 1084 const BvhTraversalData &tData = splitCandidate.mParentData;1085 BvhLeaf *leaf = tData.mNode;1086 1087 // avg contribution of a ray to a pvs1088 const float pvs = (float)CountViewCells(*tData.mSampledObjects);1089 //const float avgRayContri = AvgRayContribution((int)pvs, tData.mNumRays);1090 const float avgRaysPerObject = AvgRaysPerObject((int)pvs, tData.mNumRays);1091 1092 // high avg ray contri, the result is influenced by undersampling1093 splitCandidate.SetAvgRaysPerObject(avgRaysPerObject);1094 const float viewSpaceVol = GetViewSpaceVolume();1095 1096 const float oldVolume = EvalViewCellsVolume(*tData.mSampledObjects) / viewSpaceVol;1097 const float oldRatio = (tData.mVolume > 0) ? oldVolume / tData.mVolume : 1;1098 const float parentVol = tData.mCorrectedVolume * oldRatio;1099 1100 // this leaf is a pvs entry in all the view cells1101 // that see one of the objects.1102 splitCandidate.mVolumeFrontViewCells = EvalViewCellsVolume(splitCandidate.mSampledFrontObjects) / viewSpaceVol;1103 splitCandidate.mVolumeBackViewCells = EvalViewCellsVolume(splitCandidate.mSampledBackObjects) / viewSpaceVol;1104 1105 splitCandidate.mNumFrontViewCells = CountViewCells(splitCandidate.mSampledFrontObjects);1106 splitCandidate.mNumBackViewCells = CountViewCells(splitCandidate.mSampledBackObjects);1107 1108 splitCandidate.mCorrectedFrontVolume =1109 mHierarchyManager->EvalCorrectedPvs(splitCandidate.mVolumeFrontViewCells, parentVol, avgRaysPerObject);1110 1111 splitCandidate.mCorrectedBackVolume =1112 mHierarchyManager->EvalCorrectedPvs(splitCandidate.mVolumeBackViewCells, parentVol, avgRaysPerObject);1113 1114 #if 01115 const float relfrontCost = splitCandidate.mCorrectedFrontVolume * splitCandidate.mFrontObjects.size();1116 const float relBackCost = splitCandidate.mCorrectedBackVolume * splitCandidate.mBackObjects.size();1117 const float relParentCost = parentVol * leaf->mObjects.size();1118 #else1119 const float relfrontCost = splitCandidate.mVolumeFrontViewCells * splitCandidate.mFrontObjects.size();1120 const float relBackCost = splitCandidate.mVolumeBackViewCells * splitCandidate.mBackObjects.size();1121 const float relParentCost = oldVolume * leaf->mObjects.size();1122 #endif1123 // compute global decrease in render cost1124 const float newRenderCost = relfrontCost + relBackCost;1125 const float renderCostDecr = relParentCost - newRenderCost;1126 1127 splitCandidate.SetRenderCostDecrease(renderCostDecr);1128 1129 // increase in pvs entries1130 const int pvsEntriesIncr = EvalPvsEntriesIncr(splitCandidate,1131 avgRaysPerObject,1132 (int)pvs,1133 splitCandidate.mNumFrontViewCells,1134 splitCandidate.mNumBackViewCells);1135 1136 splitCandidate.SetPvsEntriesIncr(pvsEntriesIncr);1137 1138 #ifdef GTP_DEBUG1139 Debug << "old render cost: " << oldRenderCost << endl;1140 Debug << "new render cost: " << newRenderCost << endl;1141 Debug << "render cost decrease: " << renderCostDecr << endl;1142 #endif1143 1144 float priority = EvalPriority(splitCandidate,1145 renderCostDecr,1146 relParentCost);1147 1148 // compute global decrease in render cost1149 989 splitCandidate.SetPriority(priority); 1150 990 -
GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.h
r2347 r2350 579 579 const bool preprocessViewCells); 580 580 581 void EvalSubdivisionCandidate2(BvhSubdivisionCandidate &splitData,582 const bool computeSplitPlane,583 const bool preprocessViewCells);584 585 581 /** Returns vector of leaves. 586 582 */ -
GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp
r2347 r2350 31 31 #define HACK_PERFORMANCE 1 32 32 33 #define HAS_TO_BE_REDONE 034 33 35 34 ///////////// … … 849 848 splitCandidate.mBackPvs = (float)sData.mBackObjects; 850 849 851 #if HAS_TO_BE_REDONE852 850 return (int)(splitCandidate.mCorrectedFrontPvs + splitCandidate.mCorrectedBackPvs - correctedOldPvs); 853 #else854 return sData.mFrontObjects + sData.mBackObjects - sData.mTotalObjects;855 #endif856 851 } 857 852 … … 1627 1622 sc.mBackRenderCost = sData.mBackRenderCost; 1628 1623 1629 #if HAS_TO_BE_REDONE // undersampling evalution does not work yet1630 1631 1624 const float oldRenderCost = penaltyOld * pOverall; 1632 1625 const float newRenderCost = sc.mCorrectedFrontRenderCost * pFront + 1633 1626 sc.mCorrectedBackRenderCost * pBack; 1634 1627 1635 #else1636 1637 const float oldRenderCost = sData.mTotalRenderCost * pOverall;1638 const float newRenderCost = sData.mFrontRenderCost * pFront + sData.mBackRenderCost * pBack;1639 1640 #endif1641 1628 1642 1629 // the normalized old render cost is needed for the priority
Note: See TracChangeset
for help on using the changeset viewer.