Changeset 1139 for GTP/trunk/Lib/Vis
- Timestamp:
- 07/18/06 13:26:02 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/OnlineCullingCHC/IVReader/scripts/IVReader.vcproj
r343 r1139 20 20 Name="VCCLCompilerTool" 21 21 Optimization="0" 22 AdditionalIncludeDirectories=""$(OGRE_PATH)\Dependencies\include\CEGUI";"$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include";"$(OGRE_PATH)\OgreMain\include";"$(OGRE_PATH)\Dependencies\include";"$(OGRE_PATH)\Samples\Common\include";..\include" 22 23 PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;IVREADER_EXPORTS" 23 24 MinimalRebuild="TRUE" 24 25 BasicRuntimeChecks="3" 25 26 RuntimeLibrary="1" 26 UsePrecompiledHeader=" 3"27 UsePrecompiledHeader="0" 27 28 WarningLevel="3" 28 29 Detect64BitPortabilityProblems="TRUE" -
GTP/trunk/Lib/Vis/OnlineCullingCHC/IVReader/src/ivmanualmeshloader.cpp
r870 r1139 62 62 return data->boundingBox; 63 63 } 64 64 65 65 66 void IVManualMeshLoader::loadResource(Ogre::Resource *resource) … … 153 154 154 155 } 155 -
GTP/trunk/Lib/Vis/OnlineCullingCHC/IVReader/src/ivnode.cpp
r187 r1139 7 7 typ = IV_STRING; 8 8 } 9 10 9 11 IVField::~IVField() 10 12 { … … 14 16 } 15 17 18 16 19 IVNode::IVNode() 17 20 { … … 20 23 fields = NULL; 21 24 } 25 22 26 23 27 IVNode::IVNode(const char *s) -
GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp
r1134 r1139 2212 2212 "0.99"); 2213 2213 2214 RegisterOption("VspTree. pvsCountMethod",2215 opt Int,2216 "vsp_pvs_ count_method=",2217 " 1");2214 RegisterOption("VspTree.useKdPvs", 2215 optBool, 2216 "vsp_pvs_use_kd_pvs=", 2217 "true"); 2218 2218 2219 2219 … … 2307 2307 "osp_construction_render_cost_decrease_weight=", 2308 2308 "0.99"); 2309 2310 RegisterOption("OspTree.Construction.useEqualWeightForHeuristics",2311 optBool,2312 "osp_construction_use_equal_weight_for_heuristics=",2313 "false");2314 2309 2315 2310 -
GTP/trunk/Lib/Vis/Preprocessing/src/Exporter.cpp
r1121 r1139 3 3 #include "VspOspTree.h" 4 4 #include "KdTree.h" 5 #include "KdIntersectable.h" 5 6 6 7 … … 72 73 } 73 74 75 void Exporter::ExportKdIntersectable(const KdIntersectable &kdObj) 76 { 77 KdNode *node = kdObj.GetNode(); 78 79 Intersectable::NewMail(); 80 81 if (node->IsLeaf()) 82 { 83 KdLeaf *leaf = dynamic_cast<KdLeaf *>(node); 84 85 ObjectContainer::const_iterator oit, oit_end = leaf->mObjects.end(); 86 87 for (oit = leaf->mObjects.begin(); oit != oit_end; ++ oit) 88 { 89 Intersectable *obj = *oit; 90 91 if (!obj->Mailed()) 92 { 93 ExportIntersectable(obj); 94 obj->Mail(); 95 } 96 } 97 } 74 98 } 99 100 101 } -
GTP/trunk/Lib/Vis/Preprocessing/src/Exporter.h
r1121 r1139 28 28 class Beam; 29 29 class OspTree; 30 class KdIntersectable; 30 31 31 32 … … 146 147 147 148 virtual void ExportViewpoint(const Vector3 &point, const Vector3 &direction) = 0; 149 150 void ExportKdIntersectable(const KdIntersectable &kdObj); 148 151 }; 149 152 -
GTP/trunk/Lib/Vis/Preprocessing/src/KdIntersectable.h
r1138 r1139 52 52 53 53 54 /** Pointer to kd leaf object that was hit during ray casting. 55 */ 56 Intersectable *mHitObject; 57 54 58 protected: 55 59 -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp
r1135 r1139 260 260 261 261 262 bool ViewCell::AddKdPvsSample(KdLeaf *sample,263 const float pdf,264 float &contribution)265 {266 const bool result = mKdPvs.AddSample(sample, pdf, contribution);267 return result;268 }269 262 270 263 /************************************************************************/ -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h
r1133 r1139 191 191 bool AddPvsSample(Intersectable *sample, const float pdf, float &contribution); 192 192 193 bool AddKdPvsSample(KdLeaf *sample, const float pdf, float &contribution);194 193 195 194 /// Rays piercing this view cell. -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r1138 r1139 18 18 #include "GlRenderer.h" 19 19 #include "ResourceManager.h" 20 #include "KdIntersectable.h" 20 21 21 22 … … 5467 5468 { 5468 5469 //-- export pvs 5469 ObjectPvsMap::const_iterator oit, 5470 oit_end = pvs.mEntries.end(); 5470 ObjectPvsMap::const_iterator oit, oit_end = pvs.mEntries.end(); 5471 5471 5472 5472 Intersectable::NewMail(); … … 5482 5482 for (oit = pvs.mEntries.begin(); oit != oit_end; ++ oit) 5483 5483 { 5484 // export "original" pvs5485 5484 Intersectable *obj = (*oit).first; 5486 5485 5487 if ( 1 &&!obj->Mailed())5486 if (!obj->Mailed()) 5488 5487 { 5489 5488 exporter->ExportIntersectable(obj); … … 5491 5490 } 5492 5491 5493 // TODO matt§§5494 // export kd pvs5495 KdLeaf *kdleaf = 0;5496 5497 if ( !kdleaf->Mailed())5492 // export "original" pvs 5493 m.mDiffuseColor = RgbColor(0, 0, 1); 5494 exporter->SetForcedMaterial(m); 5495 5496 if ((*oit).first->Type() == Intersectable::KD_INTERSECTABLE) 5498 5497 { 5499 kdleaf->Mail(); 5500 kdLeaves.push_back(kdleaf); 5498 KdIntersectable *kdObj = dynamic_cast<KdIntersectable *>(obj); 5499 Intersectable *hitObj = kdObj->mHitObject; 5500 5501 if (!hitObj->Mailed()) 5502 { 5503 exporter->ExportIntersectable(hitObj); 5504 hitObj->Mail(); 5505 } 5501 5506 } 5502 } 5503 5504 m.mDiffuseColor = RgbColor(0, 0, 1); 5505 exporter->SetForcedMaterial(m); 5506 5507 //-- export kd node pvs 5508 Intersectable::NewMail(); 5509 5510 vector<KdLeaf *>::const_iterator kdit, kdit_end = kdLeaves.end(); 5511 5512 for (kdit = kdLeaves.begin(); kdit != kdit_end; ++ kdit) 5513 { 5514 KdLeaf *kdleaf = *kdit; 5515 5516 //-- export kd node 5517 5518 ObjectContainer::const_iterator oit, oit_end = kdleaf->mObjects.end(); 5519 5520 for (oit = kdleaf->mObjects.begin(); oit != oit_end; ++ oit) 5521 { 5522 Intersectable *obj = *oit; 5523 5524 if (!obj->Mailed()) 5525 { 5526 exporter->ExportIntersectable(obj); 5527 obj->Mail(); 5528 } 5529 } 5530 } 5507 } 5531 5508 } 5532 5509 -
GTP/trunk/Lib/Vis/Preprocessing/src/VrmlExporter.cpp
r1121 r1139 14 14 #include "RssTree.h" 15 15 #include "Beam.h" 16 #include "KdIntersectable.h" 17 16 18 17 19 namespace GtpVisibilityPreprocessor { … … 171 173 break; 172 174 case Intersectable::VIEW_CELL: 173 ExportViewCell( (ViewCell *)object);175 ExportViewCell(dynamic_cast<ViewCell *>(object)); 174 176 break; 177 case Intersectable::KD_INTERSECTABLE: 178 ExportKdIntersectable(*(dynamic_cast<KdIntersectable *>(object))); 175 179 default: 176 180 cerr << "Sorry the export for object not yet defined" << endl; -
GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.cpp
r1138 r1139 17 17 #include "Beam.h" 18 18 #include "KdTree.h" 19 #include "KdIntersectable.h" 19 20 20 21 … … 363 364 Environment::GetSingleton()->GetBoolValue("VspTree.simulateOctree", mCirculatingAxis); 364 365 365 Environment::GetSingleton()->Get IntValue("VspTree.pvsCountMethod", mPvsCountMethod);366 Environment::GetSingleton()->GetBoolValue("VspTree.useKdPvs", mUseKdPvs); 366 367 367 368 char subdivisionStatsLog[100]; … … 399 400 Debug << "maxband: " << mMaxBand << endl; 400 401 401 if ( mPvsCountMethod == 0)402 if (!mUseKdPvs) 402 403 Debug << "pvs count method: per object" << endl; 403 404 else … … 871 872 if (obj) 872 873 { 874 Intersectable *entry; 875 876 // potentially visible kd cells 877 if (mUseKdPvs) 878 { 879 KdLeaf *leaf = mOspTree->GetLeaf(ray->mTermination, ray->mTerminationNode); 880 KdIntersectable *kdObj = new KdIntersectable(leaf); 881 882 entry = kdObj; 883 } 884 else 885 entry = obj; 886 873 887 if (vc->AddPvsSample(obj, ray->mPdf, contribution)) 874 888 { … … 877 891 878 892 sc += contribution; 893 } 894 895 obj = ray->mOriginObject; 896 897 if (obj) 898 { 899 Intersectable *entry; 879 900 880 901 // potentially visible kd cells 881 KdLeaf *leaf =882 mOspTree->GetLeaf(ray->mTermination, ray->mTerminationNode);883 float kdcontri;884 vc->AddKdPvsSample(leaf, 1, kdcontri);885 } 886 887 obj = ray->mOriginObject;888 889 if (obj)890 { 902 if (mUseKdPvs) 903 { 904 KdLeaf *leaf = mOspTree->GetLeaf(ray->mOrigin, ray->mOriginNode); 905 KdIntersectable *kdObj = new KdIntersectable(leaf); 906 907 entry = kdObj; 908 } 909 else 910 entry = obj; 911 891 912 if (vc->AddPvsSample(obj, ray->mPdf, contribution)) 892 913 { … … 895 916 896 917 sc += contribution; 897 898 // potentially visible kd cells899 const bool origin = true;900 KdLeaf *leaf =901 mOspTree->GetLeaf(ray->mOrigin, ray->mOriginNode);902 float kdcontri;903 vc->AddKdPvsSample(leaf, 1, kdcontri);904 918 } 905 919 … … 1042 1056 if (oObject) 1043 1057 { 1044 if ( mPvsCountMethod == PER_OBJECT)1058 if (!mUseKdPvs) 1045 1059 { 1046 1060 if (!oObject->Mailed()) … … 1066 1080 if (tObject) 1067 1081 { 1068 if ( mPvsCountMethod == PER_OBJECT)1082 if (!mUseKdPvs) 1069 1083 { 1070 1084 if (!tObject->Mailed()) … … 1152 1166 if (oObject) 1153 1167 { 1154 if ( mPvsCountMethod == PER_OBJECT)1168 if (!mUseKdPvs) 1155 1169 { 1156 1170 if (ci.type == SortableEntry::ERayMin) … … 1188 1202 if (tObject) 1189 1203 { 1190 if ( mPvsCountMethod == PER_OBJECT)1204 if (!mUseKdPvs) 1191 1205 { 1192 1206 if (ci.type == SortableEntry::ERayMin) … … 2622 2636 OspTree::OspTree(): 2623 2637 mRoot(NULL), 2624 mTimeStamp(1), 2625 mUseEqualWeightForHeuristics(false) 2638 mTimeStamp(1) 2626 2639 { 2627 2640 bool randomize = false; … … 2664 2677 Environment::GetSingleton()->GetFloatValue("OspTree.Construction.renderCostDecreaseWeight", mRenderCostDecreaseWeight); 2665 2678 2666 Environment::GetSingleton()->GetBoolValue("OspTree.Construction.useEqualWeightForHeuristics", mUseEqualWeightForHeuristics);2667 2668 2679 2669 2680 //-- debug output … … 3430 3441 ObjectContainer::const_iterator oit, oit_end = leaf->mObjects.end(); 3431 3442 3432 // TODO §§matt: have to evaluateview cell volume on left and right cell3443 // evaluate reverse pvs and view cell volume on left and right cell 3433 3444 for (oit = leaf->mObjects.begin(); oit != oit_end; ++ oit) 3434 3445 { … … 4057 4068 // makes no sense otherwise because only one kd cell available 4058 4069 // during view space partition 4059 const int savedCountMethod = mVspTree.mPvsCountMethod;4060 mVspTree.m PvsCountMethod = VspTree::PER_OBJECT;4070 const bool savedCountMethod = mVspTree.mUseKdPvs; 4071 mVspTree.mUseKdPvs = false; 4061 4072 4062 4073 mTQueue.Push(PrepareVsp(sampleRays, forcedViewSpace, *viewSpaceRays)); … … 4137 4148 cout << "finished in " << TimeDiff(startTime, GetTime())*1e-3 << " secs" << endl; 4138 4149 4139 mVspTree.m PvsCountMethod= savedCountMethod;4150 mVspTree.mUseKdPvs = savedCountMethod; 4140 4151 } 4141 4152 -
GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.h
r1138 r1139 1018 1018 protected: 1019 1019 1020 int mPvsCountMethod;1020 bool mUseKdPvs; 1021 1021 1022 1022 enum {PER_OBJECT, PER_KDLEAF}; … … 1684 1684 float mEpsilon; 1685 1685 1686 1687 bool mUseEqualWeightForHeuristics;1688 1689 1686 /// subdivision stats output file 1690 1687 ofstream mSubdivisionStats;
Note: See TracChangeset
for help on using the changeset viewer.