Changeset 1687
- Timestamp:
- 10/27/06 10:39:58 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/scripts/vsposp_typical.sh
r1680 r1687 6 6 #TARGET=debug 7 7 TARGET=release 8 9 8 PROGRAM=../bin/$TARGET/Preprocessor.exe 10 11 9 echo "starting $TARGET mode" 12 10 … … 29 27 30 28 31 METHOD=interleaved_full 32 echo "$SCENE $METHOD"29 # METHOD=interleaved 30 # echo "$SCENE $METHOD" 33 31 34 32 # $PROGRAM $ENVIRONMENT \ … … 41 39 # -hierarchy_construction_recompute_split_on_repair=true 42 40 43 sh movefiles.sh $LOG_PREFIX-$METHOD41 #sh movefiles.sh $LOG_PREFIX-$METHOD 44 42 45 43 ########################################################################### 46 44 47 METHOD=interleaved 48 echo "$SCENE $METHOD"45 # METHOD=interleaved-norepair 46 # echo "$SCENE $METHOD" 49 47 50 48 # $PROGRAM $ENVIRONMENT \ … … 57 55 # -hierarchy_construction_recompute_split_on_repair=false 58 56 59 sh movefiles.sh $LOG_PREFIX-$METHOD57 #sh movefiles.sh $LOG_PREFIX-$METHOD 60 58 61 59 ################################################################################## 62 MEMCONST=1.0 63 METHOD=gradient-mem2-$MEMCONST 60 METHOD=gradient 64 61 echo "$SCENE $METHOD" 65 62 … … 75 72 -vsp_construction_render_cost_decrease_weight=0.99 \ 76 73 -hierarchy_construction_multilevel=false \ 77 -hierarchy_term_memory_const=$MEMCONST \78 74 -hierarchy_construction_recompute_split_on_repair=true 79 75 … … 81 77 82 78 83 ##################################################################################84 MEMCONST=0.585 METHOD=gradient-mem2-$MEMCONST86 echo "$SCENE $METHOD"87 88 # $PROGRAM $ENVIRONMENT \89 -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \90 -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \91 -vsp_subdivision_stats=$LOG_PREFIX-$METHOD-vsp-subdivisionStats.log \92 -bvh_subdivision_stats=$LOG_PREFIX-$METHOD-bvh-subdivisionStats.log \93 -hierarchy_subdivision_stats=$LOG_PREFIX-$METHOD-hierarchy-subdivisionStats.log \94 -hierarchy_construction_type=2 \95 -hierarchy_construction_consider_memory2=true \96 -bvh_construction_render_cost_decrease_weight=0.99 \97 -vsp_construction_render_cost_decrease_weight=0.99 \98 -hierarchy_construction_multilevel=false \99 -hierarchy_term_memory_const=$MEMCONST \100 -hierarchy_construction_recompute_split_on_repair=true101 102 sh movefiles.sh $LOG_PREFIX-$METHOD103 104 ##################################################################################105 MEMCONST=0.2106 METHOD=gradient-mem2-$MEMCONST107 echo "$SCENE $METHOD"108 109 #$PROGRAM $ENVIRONMENT \110 -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \111 -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \112 -vsp_subdivision_stats=$LOG_PREFIX-$METHOD-vsp-subdivisionStats.log \113 -bvh_subdivision_stats=$LOG_PREFIX-$METHOD-bvh-subdivisionStats.log \114 -hierarchy_subdivision_stats=$LOG_PREFIX-$METHOD-hierarchy-subdivisionStats.log \115 -hierarchy_construction_type=2 \116 -hierarchy_construction_consider_memory2=true \117 -bvh_construction_render_cost_decrease_weight=0.99 \118 -vsp_construction_render_cost_decrease_weight=0.99 \119 -hierarchy_construction_multilevel=false \120 -hierarchy_term_memory_const=$MEMCONST \121 -hierarchy_construction_recompute_split_on_repair=true122 123 sh movefiles.sh $LOG_PREFIX-$METHOD124 125 126 127 79 ############################################################################ 128 NODES=1000 080 NODES=1000 129 81 130 82 METHOD=sequential-$NODES … … 144 96 ############################################################################ 145 97 146 NODES= 7000098 NODES=10000 147 99 148 100 METHOD=sequential-$NODES … … 157 109 -hierarchy_construction_type=0 \ 158 110 -bvh_term_max_leaves=$NODES 159 160 sh movefiles.sh $LOG_PREFIX-$METHOD161 162 163 ############################################################################164 165 NODES=30000166 167 METHOD=sequential-$NODES168 echo "$SCENE $METHOD"169 170 # $PROGRAM $ENVIRONMENT \171 -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \172 -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \173 -vsp_subdivision_stats=$LOG_PREFIX-$METHOD-vsp-subdivisionStats.log \174 -bvh_subdivision_stats=$LOG_PREFIX-$METHOD-bvh-subdivisionStats.log \175 -hierarchy_subdivision_stats=$LOG_PREFIX-$METHOD-hierarchy-subdivisionStats.log \176 -hierarchy_construction_type=0 \177 -bvh_term_max_leaves=$NODES178 179 sh movefiles.sh $LOG_PREFIX-$METHOD180 181 182 ############################################################################183 184 NODES=100000185 186 METHOD=sequential-$NODES187 echo "$SCENE $METHOD"188 189 # $PROGRAM $ENVIRONMENT \190 -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \191 -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \192 -vsp_subdivision_stats=$LOG_PREFIX-$METHOD-vsp-subdivisionStats.log \193 -bvh_subdivision_stats=$LOG_PREFIX-$METHOD-bvh-subdivisionStats.log \194 -hierarchy_subdivision_stats=$LOG_PREFIX-$METHOD-hierarchy-subdivisionStats.log \195 -hierarchy_construction_type=0 \196 -bvh_term_max_leaves=$NODES197 198 sh movefiles.sh $LOG_PREFIX-$METHOD199 200 201 ##################################################################################202 MEMCONST=1.0203 METHOD=gradient-multi-$MEMCONST204 echo "$SCENE $METHOD"205 206 #$PROGRAM $ENVIRONMENT \207 -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \208 -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \209 -vsp_subdivision_stats=$LOG_PREFIX-$METHOD-vsp-subdivisionStats.log \210 -bvh_subdivision_stats=$LOG_PREFIX-$METHOD-bvh-subdivisionStats.log \211 -hierarchy_subdivision_stats=$LOG_PREFIX-$METHOD-hierarchy-subdivisionStats.log \212 -hierarchy_construction_type=2 \213 -hierarchy_construction_consider_memory2=true \214 -bvh_construction_render_cost_decrease_weight=0.99 \215 -vsp_construction_render_cost_decrease_weight=0.99 \216 -hierarchy_construction_multilevel=true \217 -hierarchy_construction_levels=4 \218 -hierarchy_term_memory_const=$MEMCONST \219 -hierarchy_construction_recompute_split_on_repair=true220 221 sh movefiles.sh $LOG_PREFIX-$METHOD222 223 224 ###############################################################225 MEMCONST=1.0226 METHOD=gradient-$MEMCONST227 echo ********" $SCENE $METHOD ************"228 229 # $PROGRAM $ENVIRONMENT \230 -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \231 -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \232 -vsp_subdivision_stats=$LOG_PREFIX-$METHOD-vsp-subdivisionStats.log \233 -bvh_subdivision_stats=$LOG_PREFIX-$METHOD-bvh-subdivisionStats.log \234 -hierarchy_subdivision_stats=$LOG_PREFIX-$METHOD-hierarchy-subdivisionStats.log \235 -hierarchy_construction_type=2 \236 -hierarchy_construction_multilevel=false \237 -hierarchy_construction_levels=4 \238 -hierarchy_construction_consider_memory=true \239 -hierarchy_term_memory_const=$MEMCONST \240 -bvh_construction_render_cost_decrease_weight=0.99 \241 -vsp_construction_render_cost_decrease_weight=0.99 \242 -hierarchy_construction_recompute_split_on_repair=true243 244 sh movefiles.sh $LOG_PREFIX-$METHOD245 246 #########################################################################247 248 MEMCONST=0.1249 METHOD=gradient-$MEMCONST250 echo ********" $SCENE $METHOD ************"251 252 #$PROGRAM $ENVIRONMENT \253 -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \254 -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \255 -vsp_subdivision_stats=$LOG_PREFIX-$METHOD-vsp-subdivisionStats.log \256 -bvh_subdivision_stats=$LOG_PREFIX-$METHOD-bvh-subdivisionStats.log \257 -hierarchy_subdivision_stats=$LOG_PREFIX-$METHOD-hierarchy-subdivisionStats.log \258 -hierarchy_construction_type=2 \259 -hierarchy_construction_multilevel=false \260 -hierarchy_construction_levels=4 \261 -hierarchy_construction_consider_memory=true \262 -hierarchy_term_memory_const=$MEMCONST \263 -bvh_construction_render_cost_decrease_weight=0.99 \264 -vsp_construction_render_cost_decrease_weight=0.99 \265 -hierarchy_construction_recompute_split_on_repair=true266 111 267 112 sh movefiles.sh $LOG_PREFIX-$METHOD … … 286 131 sh movefiles.sh $LOG_PREFIX-$METHOD 287 132 288 ##########################################################289 METHOD=gradient-500290 echo "$SCENE $METHOD"291 133 292 # $PROGRAM $ENVIRONMENT \293 -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \294 -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \295 -vsp_subdivision_stats=$LOG_PREFIX-$METHOD-vsp-subdivisionStats.log \296 -bvh_subdivision_stats=$LOG_PREFIX-$METHOD-bvh-subdivisionStats.log \297 -hierarchy_subdivision_stats=$LOG_PREFIX-$METHOD-hierarchy-subdivisionStats.log \298 -hierarchy_construction_type=2 \299 -hierarchy_construction_consider_memory=false \300 -hierarchy_construction_min_steps_same_type=500 \301 -hierarchy_construction_multilevel=false \302 -hierarchy_construction_recompute_split_on_repair=true303 304 sh movefiles.sh $LOG_PREFIX-$METHOD305 306 307 ############################################################################308 -
GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
r1686 r1687 415 415 backData.mMaxCostMisses = sc.GetMaxCostMisses(); 416 416 417 // node->mRenderCostDecr = sc.GetRenderCostDecrease();418 //node->mPvsEntriesIncr = sc.GetPvsEntriesIncr();419 417 // set the time stamp so the order of traversal can be reconstructed 418 node->mTimeStamp = mHierarchyManager->mTimeStamp ++; 419 420 420 // assign the objects in sorted order 421 421 if (mUseGlobalSorting) … … 449 449 currentNode = SubdivideNode(*sc, tFrontData, tBackData); 450 450 451 // set the time stamp so the order of traversal can be reconstructed452 currentNode->mTimeStamp = mHierarchyManager->mTimeStamp ++;453 //currentNode->mRenderCostDecr = sc.GetRenderCostDecrease();454 //currentNode->mPvsEntriesIncr = sc.GetPvsEntriesIncr();455 456 451 // decrease the weighted average cost of the subdivisoin 457 452 mTotalCost -= sc->GetRenderCostDecrease(); … … 899 894 // (as we are not sampling volumetric visibility, 900 895 // this should provide better heuristics 901 const float area = //obox.SurfaceArea();896 const float area = obj->GetArea();//obox.SurfaceArea(); 902 897 903 898 al += area; … … 2141 2136 currentNode = SubdivideNode(*sc, tFrontData, tBackData); 2142 2137 2143 currentNode->mRenderCostDecr = oldNode->mRenderCostDecr +sc->GetRenderCostDecrease();2144 currentNode->mPvsEntriesIncr = oldNode->mPvsEntriesIncr +sc->GetPvsEntriesIncr();2145 2138 oldNode->mRenderCostDecr += sc->GetRenderCostDecrease(); 2139 oldNode->mPvsEntriesIncr += sc->GetPvsEntriesIncr(); 2140 cout << "here5" << endl; 2146 2141 /////////////////////////// 2147 2142 //-- push the new split candidates on the queue … … 2151 2146 2152 2147 frontCandidate->SetPriority((float)-oldInterior->GetFront()->mTimeStamp); 2153 backCandidate->SetPriority((float)-oldInterior->Get Front()->mTimeStamp);2148 backCandidate->SetPriority((float)-oldInterior->GetBack()->mTimeStamp); 2154 2149 2155 2150 frontCandidate->mEvaluationHack = oldInterior->GetFront(); -
GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp
r1686 r1687 1667 1667 firstBvh->mEvaluationHack = oldBvhRoot; 1668 1668 1669 firstVsp->SetPriority((float)-oldVspRoot->mTimeStamp); 1670 firstBvh->SetPriority((float)-oldBvhRoot->mTimeStamp); 1671 1669 1672 tQueue.Push(firstVsp); 1670 1673 tQueue.Push(firstBvh); … … 1726 1729 cout << "next candidate: " << nextCandidate->GetPriority() << endl; 1727 1730 1728 if (nextCandidate->Type() == SubdivisionCandidate::VIEW_SPACE) 1731 if (nextCandidate->Type() == SubdivisionCandidate::VIEW_SPACE) 1732 { 1733 cout << "here8" << endl; 1729 1734 mVspTree->SubdivideAndCopy(tQueue, nextCandidate); 1735 1736 VspNode *oldNode = (VspNode *)nextCandidate->mEvaluationHack; 1737 1738 totalRenderCost -= oldNode->mRenderCostDecr; 1739 entriesInPvs += oldNode->mPvsEntriesIncr; 1740 } 1730 1741 else 1742 {cout << "here9" << endl; 1731 1743 mBvHierarchy->SubdivideAndCopy(tQueue, nextCandidate); 1732 1733 totalRenderCost -= nextCandidate->GetRenderCostDecrease(); 1734 entriesInPvs += nextCandidate->GetPvsEntriesIncr(); 1744 1745 BvhNode *oldNode = (BvhNode *)nextCandidate->mEvaluationHack; 1746 1747 totalRenderCost -= oldNode->mRenderCostDecr; 1748 entriesInPvs += oldNode->mPvsEntriesIncr; 1749 } 1735 1750 1736 1751 ++ steps; 1737 1752 cout << "rc: " << nextCandidate->GetRenderCostDecrease() << endl; 1753 cout << "pvs: " << nextCandidate->GetPvsEntriesIncr() << endl; 1754 1738 1755 const float memoryCost = (float)entriesInPvs * (float)ObjectPvs::GetEntrySize(); 1739 1756 UpdateStats(stats, steps, totalRenderCost, entriesInPvs, memoryCost, false); -
GTP/trunk/Lib/Vis/Preprocessing/src/Intersectable.h
r1686 r1687 112 112 virtual float GetArea() const {return 0; } 113 113 virtual int GetRandomSurfacePoint(Vector3 &point, Vector3 &normal) = 0; 114 115 virtual int GetRandomVisibleSurfacePoint(Vector3 &point,116 Vector3 &normal,117 const Vector3 &viewpoint,118 const int maxTries) = 0;119 120 virtual ostream &Describe(ostream &s) = 0;121 122 virtual int GenerateSilhouetteRays(const int nrays,123 const AxisAlignedBox3 &originBox,124 const AxisAlignedBox3 &directionBox, VssRayContainer &rays)125 {126 return 0;127 }128 114 129 static bool GreaterCounter(const Intersectable *a, 130 const Intersectable *b) 131 { 132 return a->mCounter > b->mCounter; 133 } 115 virtual int GetRandomVisibleSurfacePoint(Vector3 &point, 116 Vector3 &normal, 117 const Vector3 &viewpoint, 118 const int maxTries) = 0; 134 119 135 static string GetTypeName(Intersectable *obj) 136 { 137 switch(obj->Type()) 138 { 139 case MESH_INSTANCE: 140 return "mesh_instance\n"; 141 142 case TRANSFORMED_MESH_INSTANCE: 143 return "transformed_mesh_instance\n"; 144 145 case SPHERE: 146 return "sphere\n"; 120 virtual ostream &Describe(ostream &s) = 0; 147 121 148 case VIEW_CELL: 149 return "view cell\n"; 150 151 case OGRE_MESH_INSTANCE: 152 return "ogre_mesh_instance\n"; 122 virtual int GenerateSilhouetteRays(const int nrays, 123 const AxisAlignedBox3 &originBox, 124 const AxisAlignedBox3 &directionBox, VssRayContainer &rays) 125 { 126 return 0; 127 } 153 128 154 case KD_INTERSECTABLE: 155 return "kd_intersectable\n"; 129 static bool GreaterCounter(const Intersectable *a, 130 const Intersectable *b) 131 { 132 return a->mCounter > b->mCounter; 133 } 156 134 157 default: 158 return "unknown\n"; 159 } 160 } 135 static string GetTypeName(Intersectable *obj) 136 { 137 switch(obj->Type()) 138 { 139 case MESH_INSTANCE: 140 return "mesh_instance\n"; 161 141 162 /** returns normal from the face with the specified index. 163 PROBLEM: Does not fit to all intersectable types (e.g., spheres) 164 */ 165 virtual Vector3 GetNormal(const int idx) const { return Vector3(0, 0, 0); } 142 case TRANSFORMED_MESH_INSTANCE: 143 return "transformed_mesh_instance\n"; 144 145 case SPHERE: 146 return "sphere\n"; 147 148 case VIEW_CELL: 149 return "view cell\n"; 150 151 case OGRE_MESH_INSTANCE: 152 return "ogre_mesh_instance\n"; 153 154 case KD_INTERSECTABLE: 155 return "kd_intersectable\n"; 156 157 default: 158 return "unknown\n"; 159 } 160 } 161 162 /** returns normal from the face with the specified index. 163 PROBLEM: Does not fit to all intersectable types (e.g., spheres) 164 */ 165 virtual Vector3 GetNormal(const int idx) const { return Vector3(0, 0, 0); } 166 166 }; 167 167 -
GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp
r1686 r1687 721 721 tBackData.mMaxCostMisses = maxCostMisses; 722 722 723 //newNode->mRenderCostDecr = sc->GetRenderCostDecrease();724 //newNode->mPvsEntriesIncr = sc->GetPvsEntriesIncr();725 726 // set the time stamp so the order of traversal can be reconstructed727 newNode->mTimeStamp = mHierarchyManager->mTimeStamp ++;728 729 723 mTotalCost -= sc->GetRenderCostDecrease(); 730 724 mTotalPvsSize += tFrontData.mPvs + tBackData.mPvs - tData.mPvs; … … 970 964 CreateViewCell(frontData, false); 971 965 CreateViewCell(backData, false); 966 967 // set the time stamp so the order of traversal can be reconstructed 968 interior->mTimeStamp = mHierarchyManager->mTimeStamp ++; 972 969 973 970 #if WORK_WITH_VIEWCELL_PVS … … 3306 3303 // create new interior node and two leaf node 3307 3304 const AxisAlignedPlane splitPlane = oldInterior->GetPlane(); 3308 const int maxCostMisses = sc->GetMaxCostMisses(); 3305 3306 // evaluate the changes in render cost and pvs entries 3307 EvalSubdivisionCandidate(*sc, false); 3309 3308 3310 3309 newNode = SubdivideNode(splitPlane, tData, tFrontData, tBackData); 3311 3310 3312 // how often was max cost ratio missed in this branch? 3313 tFrontData.mMaxCostMisses = maxCostMisses; 3314 tBackData.mMaxCostMisses = maxCostMisses; 3315 3316 newNode->mRenderCostDecr = oldNode->mRenderCostDecr + sc->GetRenderCostDecrease(); 3317 newNode->mPvsEntriesIncr = oldNode->mPvsEntriesIncr + sc->GetPvsEntriesIncr(); 3318 3311 oldNode->mRenderCostDecr += sc->GetRenderCostDecrease(); 3312 oldNode->mPvsEntriesIncr += sc->GetPvsEntriesIncr(); 3313 cout << "here4" << endl; 3314 3319 3315 ///////////// 3320 3316 //-- evaluate new split candidates for global greedy cost heuristics … … 3324 3320 3325 3321 frontCandidate->SetPriority((float)-oldInterior->GetFront()->mTimeStamp); 3326 backCandidate->SetPriority((float)-oldInterior->Get Front()->mTimeStamp);3322 backCandidate->SetPriority((float)-oldInterior->GetBack()->mTimeStamp); 3327 3323 3328 3324 frontCandidate->mEvaluationHack = oldInterior->GetFront();
Note: See TracChangeset
for help on using the changeset viewer.