Changeset 1664 for GTP/trunk/Lib/Vis
- Timestamp:
- 10/23/06 01:36:17 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/scripts/vsposp_typical.sh
r1663 r1664 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 … … 133 133 134 134 135 ############################################################### 136 137 METHOD=gradient-2 138 echo ********" $SCENE $METHOD ************" 139 140 $PROGRAM $ENVIRONMENT \ 141 -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \ 142 -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \ 143 -vsp_subdivision_stats=$LOG_PREFIX-$METHOD-vsp-subdivisionStats.log \ 144 -bvh_subdivision_stats=$LOG_PREFIX-$METHOD-bvh-subdivisionStats.log \ 145 -hierarchy_subdivision_stats=$LOG_PREFIX-$METHOD-hierarchy-subdivisionStats.log \ 146 -hierarchy_construction_type=2 \ 147 -hierarchy_construction_multilevel=false \ 148 -hierarchy_construction_levels=4 \ 149 -hierarchy_construction_consider_memory=true \ 150 -bvh_construction_render_cost_decrease_weight=0.99 \ 151 -vsp_construction_render_cost_decrease_weight=0.99 \ 152 -hierarchy_construction_recompute_split_on_repair=true 153 154 sh movefiles.sh $LOG_PREFIX-$METHOD 155 156 135 157 ######################################################################## 136 158 … … 138 160 echo "$SCENE $METHOD" 139 161 140 #$PROGRAM $ENVIRONMENT \162 $PROGRAM $ENVIRONMENT \ 141 163 -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \ 142 164 -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \ … … 148 170 -hierarchy_construction_type=2 \ 149 171 -hierarchy_construction_recompute_split_on_repair=true 150 151 sh movefiles.sh $LOG_PREFIX-$METHOD152 153 ###############################################################154 155 METHOD=gradient-multi156 echo ********" $SCENE $METHOD ************"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 -bvh_construction_render_cost_decrease_weight=0.6 \168 -vsp_construction_render_cost_decrease_weight=0.6 \169 -hierarchy_construction_recompute_split_on_repair=true170 172 171 173 sh movefiles.sh $LOG_PREFIX-$METHOD -
GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
r1663 r1664 25 25 #define PROBABILIY_IS_BV_VOLUME 1 26 26 #define USE_FIXEDPOINT_T 0 27 28 27 #define USE_VOLUMES_FOR_HEURISTICS 1 29 30 #define CONSIDER_MEMORY 131 28 32 29 int BvhNode::sMailId = 10000; //2147483647; … … 429 426 430 427 // create new interior node and two leaf node 431 currentNode = SubdivideNode( 432 *sc, 433 tFrontData, 434 tBackData); 428 currentNode = SubdivideNode(*sc, tFrontData, tBackData); 435 429 436 430 // decrease the weighted average cost of the subdivisoin … … 457 451 tBackData.mNode->SetSubdivisionCandidate(backCandidate); 458 452 453 //cout << "f: " << frontCandidate->GetPriority() << " b: " << backCandidate->GetPriority() << endl; 459 454 tQueue.Push(frontCandidate); 460 455 tQueue.Push(backCandidate); … … 466 461 if (currentNode->IsLeaf()) 467 462 { 468 ///////////////////// /////////////////463 ///////////////////// 469 464 //-- store additional info 470 465 EvaluateLeafStats(tData); … … 530 525 #endif 531 526 532 #if 1533 527 float priority; 534 528 535 529 if (mHierarchyManager->GetViewSpaceSubdivisionType() == 536 530 HierarchyManager::NO_VIEWSPACE_SUBDIV) … … 551 545 // take render cost of node into account 552 546 // otherwise danger of being stuck in a local minimum!! 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 558 } 559 560 #else 561 const float priority = (float)-splitCandidate.mParentData.mDepth; 562 #endif 547 if (mHierarchyManager->mConsiderMemory) 548 { 549 //cout << "here7 rc: " << factor * renderCostDecr << " pvs: " << (1.0f - factor) * splitCandidate.GetPvsEntriesIncr() << endl; 550 //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; 556 } 557 } 558 559 // compute global decrease in render cost 560 splitCandidate.SetPriority(priority); 561 } 562 563 564 float BvHierarchy::EvalPriority(const BvhSubdivisionCandidate &splitCandidate) const 565 { 566 BvhLeaf *leaf = splitCandidate.mParentData.mNode; 567 568 const float oldRenderCost = EvalRenderCost(leaf->mObjects); 563 569 564 570 // compute global decrease in render cost 565 splitCandidate.SetPriority(priority); 566 } 567 568 569 float BvHierarchy::EvalPriority(const BvhSubdivisionCandidate &splitCandidate) const 570 { 571 BvhLeaf *leaf = splitCandidate.mParentData.mNode; 572 573 const float oldRenderCost = EvalRenderCost(leaf->mObjects); 574 575 // compute global decrease in render cost 576 const float newRenderCost = 577 EvalRenderCost(splitCandidate.mFrontObjects) + 578 EvalRenderCost(splitCandidate.mBackObjects); 571 const float newRenderCost = EvalRenderCost(splitCandidate.mFrontObjects) + 572 EvalRenderCost(splitCandidate.mBackObjects); 579 573 580 574 const float renderCostDecr = oldRenderCost - newRenderCost; … … 586 580 #endif 587 581 588 #if 1589 582 // take render cost of node into account 590 583 // otherwise danger of being stuck in a local minimum!! 591 584 const float factor = mRenderCostDecreaseWeight; 585 586 float priority; 587 592 588 // $$ matt temp 593 #if CONSIDER_MEMORY 594 const float priority = factor * renderCostDecr - (1.0f - factor) * splitCandidate.GetPvsEntriesIncr(); 595 #else 596 const float priority = factor * renderCostDecr + (1.0f - factor) * oldRenderCost; 597 #endif 598 #else 599 const float priority = (float)-splitCandidate.mParentData.mDepth; 600 #endif 589 if (mHierarchyManager->mConsiderMemory) 590 { 591 //cout << "here5 rc: " << factor * renderCostDecr << " pvs: " << (1.0f - factor) * splitCandidate.GetPvsEntriesIncr() << endl; 592 //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 } 601 599 602 600 return priority; … … 620 618 || ((int)data.mNode->mObjects.size() <= mTermMinObjects) 621 619 //|| (data.mProbability <= mTermMinProbability) 622 //|| (data.mNumRays <= mTermMinRays)620 || (data.mNumRays <= mTermMinRays) 623 621 ); 624 622 } … … 952 950 cout << "\n\nobjects=(" << (int)objectsBack.size() << "," << (int)objectsFront.size() << " of " 953 951 << (int)tData.mNode->mObjects.size() << ")\t area=(" 954 << areaLeft << "," << areaRight << ")" << endl ;955 cout<< "cost= " << minSum << endl;952 << areaLeft << "," << areaRight << ")" << endl 953 << "cost= " << minSum << endl; 956 954 #endif 955 957 956 return ratio; 958 957 } -
GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.h
r1663 r1664 418 418 bool Apply(SplitQueue &splitQueue, bool terminationCriteriaMet) 419 419 { 420 BvhNode *n = sBvHierarchy->Subdivide(splitQueue, this, terminationCriteriaMet); 420 BvhNode *n = 421 sBvHierarchy->Subdivide(splitQueue, this, terminationCriteriaMet); 421 422 // local or global termination criteria failed 422 423 return !n->IsLeaf(); -
GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp
r1663 r1664 428 428 vspPriority = viewSpaceQueue.Top()->GetPriority(); 429 429 430 if (mConsiderMemory) 430 // rather take this into account directly when computing priority 431 if (0 && mConsiderMemory) 431 432 vspPriority /= ((float)viewSpaceQueue.Top()->GetPvsEntriesIncr() + Limits::Small); 432 433 } … … 436 437 } 437 438 438 float ospPriority = 0;439 float ospPriority; 439 440 440 441 if (!objectSpaceQueue.Empty()) 441 442 { 442 443 ospPriority = objectSpaceQueue.Top()->GetPriority(); 443 444 if (mConsiderMemory) 444 445 // rather take this into account directly when computing priority 446 if (0 && mConsiderMemory) 445 447 ospPriority /= ((float)objectSpaceQueue.Top()->GetPvsEntriesIncr() + Limits::Small); 446 448 } … … 516 518 mHierarchyStats.Reset(); 517 519 mHierarchyStats.Start(); 518 mHierarchyStats.mNodes = 2; // two nodes for view space and object space 520 521 // two nodes for view space and object space 522 mHierarchyStats.mNodes = 2; 519 523 mHierarchyStats.mPvsEntries = 1; 520 524 mHierarchyStats.mMemory = sizeof(PvsData) + sizeof(Intersectable *) / (1024.0f * 1024.0f); -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r1662 r1664 957 957 { 958 958 // always try to load the kd tree 959 cout << "loading kd tree file " << internKdTree << " ... " ;959 cout << "loading kd tree file " << internKdTree << " ... " << endl; 960 960 961 961 if (!LoadKdTree(internKdTree)) -
GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp
r1663 r1664 28 28 29 29 #define USE_FIXEDPOINT_T 0 30 #define CONSIDER_MEMORY 131 30 32 31 ///////////// … … 819 818 splitCandidate.SetPvsEntriesIncr(pvsEntriesIncr); 820 819 821 #if 0822 const float priority = (float)-splitCandidate.mParentData.mDepth;823 #else824 820 // take render cost of node into account 825 821 // otherwise danger of being stuck in a local minimum!! 826 822 const float factor = mRenderCostDecreaseWeight; 827 823 828 #if CONSIDER_MEMORY 829 const float priority = factor * renderCostDecr - (1.0f - factor) * splitCandidate.GetPvsEntriesIncr(); 830 #else 831 const float priority = factor * renderCostDecr + (1.0f - factor) * oldRenderCost; 832 #endif 833 #endif 824 float priority; 825 826 if (mHierarchyManager->mConsiderMemory) 827 { 828 //cout << "here4 rc: " << factor * renderCostDecr << " pvs: " << (1.0f - factor) * splitCandidate.GetPvsEntriesIncr() << endl; 829 //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; 835 } 834 836 835 837 splitCandidate.SetPriority(priority); … … 845 847 oldRenderCost); 846 848 847 #if 0848 const float priority = (float)-splitCandidate.mParentData.mDepth;849 #else850 849 // take render cost of node into account 851 850 // otherwise danger of being stuck in a local minimum!! 852 851 const float factor = mRenderCostDecreaseWeight; 853 #if CONSIDER_MEMORY 854 const float priority = factor * renderCostDecr - (1.0f - factor) * splitCandidate.GetPvsEntriesIncr(); 855 #else 856 const float priority = factor * renderCostDecr + (1.0f - factor) * oldRenderCost; 857 #endif 858 859 #endif 860 852 853 float priority; 854 855 if (mHierarchyManager->mConsiderMemory) 856 { 857 //cout << "here2 rc: " << factor * renderCostDecr << " pvs: " << (1.0f - factor) * splitCandidate.GetPvsEntriesIncr() << endl; 858 //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; 864 } 865 861 866 return priority; 862 867 } … … 917 922 918 923 //-- subdivide rays 919 SplitRays(splitPlane, 920 *tData.mRays, 921 *frontData.mRays, 922 *backData.mRays); 924 SplitRays(splitPlane, *tData.mRays, *frontData.mRays, *backData.mRays); 923 925 924 926 //-- compute pvs … … 946 948 // two more leaves per split 947 949 mVspStats.nodes += 2; 948 // /and a new split950 // and a new split 949 951 ++ mVspStats.splits[splitPlane.mAxis]; 950 952 -
GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.h
r1663 r1664 1086 1086 float mEpsilon; 1087 1087 1088 1089 1088 /// subdivision stats output file 1090 1089 ofstream mSubdivisionStats;
Note: See TracChangeset
for help on using the changeset viewer.