- Timestamp:
- 05/30/08 03:47:56 (16 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/scripts/run_gvs_vps.sh
r2726 r2727 42 42 -gvs_total_samples=1000000 \ 43 43 -gvs_samples_per_pass=1000000 \ 44 -gvs_initial_samples= 2000 \44 -gvs_initial_samples=50 \ 45 45 -gvs_max_viewcells=1 \ 46 -gvs_min_contribution=50 \46 -gvs_min_contribution=500 \ 47 47 -gvs_per_viewcell=true \ 48 48 -preprocessor_detect_empty_viewspace+ \ -
GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp
r2726 r2727 1573 1573 int i = 0; 1574 1574 1575 // $ tmp matt: somehow this is not properly initialised1576 ClearErrorBuffer();1577 cout << "here4 " << mPvsErrorBuffer.size() << endl;1575 // $matt tmp: somehow this is not properly initialised 1576 //ClearErrorBuffer(); 1577 1578 1578 for (sit = viewPoints.begin(); sit != sit_end; ++ sit, ++ i) 1579 1579 { -
GTP/trunk/Lib/Vis/Preprocessing/src/GtpVisibility05.vcproj
r2720 r2727 770 770 </File> 771 771 <File 772 RelativePath=".\IntelRayCaster.h"773 >774 </File>775 <File776 RelativePath=".\InternalRayCaster.h"777 >778 </File>779 <File780 772 RelativePath=".\Intersectable.h" 781 773 > … … 855 847 <File 856 848 RelativePath=".\Ray.h" 857 >858 </File>859 <File860 RelativePath=".\RayCaster.h"861 849 > 862 850 </File> … … 988 976 </File> 989 977 <File 990 RelativePath=".\IntelRayCaster.cpp"991 >992 </File>993 <File994 RelativePath=".\InternalRayCaster.cpp"995 >996 </File>997 <File998 978 RelativePath=".\Intersectable.cpp" 999 979 > … … 1052 1032 </File> 1053 1033 <File 1054 RelativePath=".\RayCaster.cpp"1055 >1056 </File>1057 <File1058 1034 RelativePath=".\RayInfo.cpp" 1059 1035 > … … 1132 1108 </File> 1133 1109 </Filter> 1110 </Filter> 1111 <Filter 1112 Name="raycaster" 1113 > 1114 <File 1115 RelativePath=".\IntelRayCaster.cpp" 1116 > 1117 </File> 1118 <File 1119 RelativePath=".\IntelRayCaster.h" 1120 > 1121 </File> 1122 <File 1123 RelativePath=".\InternalRayCaster.cpp" 1124 > 1125 </File> 1126 <File 1127 RelativePath=".\InternalRayCaster.h" 1128 > 1129 </File> 1130 <File 1131 RelativePath=".\RayCaster.cpp" 1132 > 1133 </File> 1134 <File 1135 RelativePath=".\RayCaster.h" 1136 > 1137 </File> 1134 1138 </Filter> 1135 1139 </Files> -
GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp
r2726 r2727 425 425 castTimer.Entry(); 426 426 // cast single ray to check if a triangle was missed 427 // note: not efficient!! 427 428 VssRay *newRay = mRayCaster->CastRay(sray, mViewCellsManager->GetViewSpaceBox(), !mPerViewCell); 428 429 castTimer.Exit(); … … 433 434 if (!newRay) return castRays; 434 435 436 rayTimer.Entry(); 437 435 438 // new triangle discovered? => add new ray to queue 436 rayTimer.Entry();437 439 HandleRay(newRay); 440 438 441 rayTimer.Exit(); 439 440 441 442 442 443 #else … … 795 796 castTimer.Exit(); 796 797 797 mGvsStats.mReverseSamples += reverseRays.size();798 mGvsStats.mReverseSamples += (int)reverseRays.size(); 798 799 799 800 return true; … … 809 810 simpleRays.clear(); 810 811 811 812 812 generationTimer.Entry(); 813 813 814 ViewCellBorderBasedDistribution vcStrat(*this, mCurrentViewCell); 814 GenerateRays(numSamples, *mDistribution, simpleRays, sInvalidSamples); 815 GenerateRays(numSamples, *mDistribution, simpleRays, sInvalidSamples); 816 815 817 generationTimer.Exit(); 816 818 817 //cout << "sr: " << simpleRays.size() << endl; 818 // generate vss rays 819 // cast generated samples 819 820 static VssRayContainer samples; 820 821 samples.clear(); … … 823 824 const bool pruneInvalidRays = true; 824 825 826 #if 0 825 827 castTimer.Entry(); 828 826 829 CastRays(simpleRays, samples, castDoubleRays, pruneInvalidRays); 830 827 831 castTimer.Exit(); 832 833 #else 834 static SimpleRayContainer jitteredRays; 835 836 for (size_t i = 0; i < simpleRays.size(); ++ i) 837 { 838 SimpleRay mainRay = simpleRays[i]; 839 840 jitteredRays.clear(); 841 jitteredRays.push_back(mainRay); 842 843 generationTimer.Entry(); 844 845 GenerateJitteredRays(jitteredRays, mainRay, 15, 0); 846 847 generationTimer.Exit(); 848 castTimer.Entry(); 849 850 CastRays(jitteredRays, samples, castDoubleRays, pruneInvalidRays); 851 852 castTimer.Entry(); 853 } 854 #endif 828 855 829 856 // add to ray queue … … 832 859 initialTimer.Exit(); 833 860 834 return (int)s impleRays.size();861 return (int)samples.size(); 835 862 } 836 863 … … 1434 1461 int oldContribution = 0; 1435 1462 int passSamples = 0; 1436 for (int i = 0; i < 0; ++ i) 1463 1464 for (int i = 0; i < 2; ++ i) 1437 1465 mGenericStats[i] = 0; 1438 1466 … … 1558 1586 mGvsStats.mPvsCost = 0; // todo objectPvs.EvalPvsCost(); 1559 1587 } 1560 else if (0) // compute pvs kd nodes that intersect view cell 1561 { 1562 ObjectContainer mykdobjects; 1563 1564 // extract kd pvs 1565 ObjectContainer::const_iterator it, it_end = mTrianglePvs.end(); 1566 1567 for (it = mTrianglePvs.begin(); it != it_end; ++ it) 1568 { 1569 Intersectable *obj = *it; 1570 // find intersecting objects not yet in pvs (i.e., only unmailed) 1571 mKdTree->CollectKdObjects(obj->GetBox(), mykdobjects); 1572 } 1573 1574 // add pvs 1575 it_end = mykdobjects.end(); 1576 1577 for (it = mykdobjects.begin(); it != it_end; ++ it) 1578 { 1579 mCurrentViewCell->GetPvs().AddSampleDirty(*it, 1.0f); 1580 } 1581 1582 cout << "added " << (int)mykdobjects.size() << " new objects " << endl; 1583 1584 mGvsStats.mPerViewCellPvs = mCurrentViewCell->GetPvs().GetSize(); 1585 mGvsStats.mPvsCost = mCurrentViewCell->GetPvs().EvalPvsCost(); 1588 else 1589 { 1590 if (0) // compute pvs kd nodes that intersect view cell 1591 { 1592 ObjectContainer mykdobjects; 1593 1594 // extract kd pvs 1595 ObjectContainer::const_iterator it, it_end = mTrianglePvs.end(); 1596 1597 for (it = mTrianglePvs.begin(); it != it_end; ++ it) 1598 { 1599 Intersectable *obj = *it; 1600 // find intersecting objects not yet in pvs (i.e., only unmailed) 1601 mKdTree->CollectKdObjects(obj->GetBox(), mykdobjects); 1602 } 1603 1604 // add pvs 1605 it_end = mykdobjects.end(); 1606 1607 for (it = mykdobjects.begin(); it != it_end; ++ it) 1608 { 1609 mCurrentViewCell->GetPvs().AddSampleDirty(*it, 1.0f); 1610 } 1611 1612 cout << "added " << (int)mykdobjects.size() << " new objects " << endl; 1613 } 1614 1615 mGvsStats.mPerViewCellPvs = mCurrentViewCell->GetPvs().GetSize(); 1616 mGvsStats.mPvsCost = mCurrentViewCell->GetPvs().EvalPvsCost(); 1586 1617 1587 1618 } … … 1602 1633 << mGvsStats.mPvsCost << " pvs tri: " << mTrianglePvs.size() << endl; 1603 1634 1604 cout << "invalid samples ratio: " << (float)sInvalidSamples / mGvsStats.mPerViewCellSamples << endl;1635 //cout << "invalid samples ratio: " << (float)sInvalidSamples / mGvsStats.mPerViewCellSamples << endl; 1605 1636 1606 1637 float rayTime = rayTimer.TotalTime(); -
GTP/trunk/Lib/Vis/Preprocessing/src/ObjectPvs.cpp
r2723 r2727 35 35 36 36 // already processed node (=> objects already in pvs)? 37 if (1)//!node->Mailed()) 37 //node->Mail(); 38 if (node->IsLeaf()) 38 39 { 39 //node->Mail(); 40 if (node->IsLeaf()) 40 KdLeaf *leaf = static_cast<KdLeaf *>(node); 41 42 // Objects already accounted for can only be found among those 43 // which are referenced in more than one leaf 44 ObjectContainer::const_iterator oit, oit_end = leaf->mObjects.end(); 45 46 for (oit = leaf->mObjects.begin(); oit != oit_end; ++ oit) 41 47 { 42 KdLeaf *leaf = static_cast<KdLeaf *>(node); 43 #if USE_MULTIPLE_OBJECTS 44 // add #objects exclusivly in this node 45 pvs += (int)(leaf->mObjects.size() - leaf->mMultipleObjects.size()); 48 Intersectable *obj = *oit; 46 49 47 // Objects already accounted for can only be found among those 48 // which are referenced in more than one leaf 49 ObjectContainer::const_iterator oit, oit_end = leaf->mMultipleObjects.end(); 50 51 for (oit = leaf->mMultipleObjects.begin(); oit != oit_end; ++ oit) 50 if (!obj->Mailed2()) 52 51 { 53 Intersectable *obj = *oit; 54 55 if (1)//!obj->Mailed()) 56 { 57 //obj->Mail(); 58 if (dummyPvs.AddSample(obj)) 59 ++ pvs; 60 } 52 //if (dummyPvs.AddSample(obj, 1.0f))++ pvs; 53 obj->Mail2(); 54 ++ pvs; 61 55 } 62 #else 56 } 57 } 58 else // traverse tree 59 { 60 KdInterior *interior = static_cast<KdInterior *>(node); 63 61 64 // Objects already accounted for can only be found among those 65 // which are referenced in more than one leaf 66 ObjectContainer::const_iterator oit, oit_end = leaf->mObjects.end(); 67 68 for (oit = leaf->mObjects.begin(); oit != oit_end; ++ oit) 69 { 70 Intersectable *obj = *oit; 71 72 if (!obj->Mailed2()) 73 { 74 //if (dummyPvs.AddSample(obj, 1.0f))++ pvs; 75 obj->Mail2(); 76 ++pvs; 77 } 78 } 79 80 #endif 81 } 82 else // traverse tree 83 { 84 KdInterior *interior = static_cast<KdInterior *>(node); 85 86 tStack.push(interior->mFront); 87 tStack.push(interior->mBack); 88 } 62 tStack.push(interior->mFront); 63 tStack.push(interior->mBack); 89 64 } 90 65 } -
GTP/trunk/Lib/Vis/Preprocessing/src/ReverseGvs.cpp
r2686 r2727 411 411 412 412 if (counter < 50) { 413 sprintf (filename, "reverse_rays_%03d.x3d", counter++);413 sprintf_s(filename, "reverse_rays_%03d.x3d", counter++); 414 414 415 415 VssRay tRay(origin, termination, NULL, NULL); … … 454 454 Vector3 455 455 ReverseGvs::ComputeSilhouetteTerminationMutation(const VssRay &ray, 456 457 458 459 460 461 456 const Vector3 &origin, 457 const AxisAlignedBox3 &box, 458 const Vector3 &U, 459 const Vector3 &V, 460 const float radius 461 ) 462 462 { 463 463 #ifdef GTP_INTERNAL
Note: See TracChangeset
for help on using the changeset viewer.