- Timestamp:
- 11/10/05 01:09:53 (19 years ago)
- Location:
- trunk/VUT/GtpVisibilityPreprocessor
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/scripts/default.env
r397 r399 56 56 57 57 Sampling { 58 totalSamples 25000058 totalSamples 100000 59 59 samplesPerPass 3 60 60 } … … 88 88 # input fromViewCells 89 89 # input fromSceneGeometry 90 samples 10000090 samples 50000 91 91 sideTolerance 0.005 92 92 } … … 126 126 #splitPlaneStrategy 130 127 127 128 splitPlaneStrategy 1024128 splitPlaneStrategy 8 129 129 130 maxPolyCandidates 200130 maxPolyCandidates 50 131 131 maxRayCandidates 0 132 132 … … 134 134 # autopartition 135 135 maxRays 200 136 maxPolygons 5136 maxPolygons 20 137 137 maxDepth 30 138 minPvs 50138 minPvs -1 139 139 minArea -0.001 140 140 … … 158 158 exportSplits true 159 159 # how much samples should be used in visualization 160 samples 1000 160 samples 100000 161 161 } 162 162 } -
trunk/VUT/GtpVisibilityPreprocessor/src/SamplingPreprocessor.cpp
r396 r399 192 192 193 193 if (!ray.intersections.empty()) // second intersection found 194 195 196 197 194 { 195 sampleContributions += 196 AddObjectSamples(ray.intersections[0].mObject, ray); 197 } 198 198 } 199 199 } … … 475 475 { 476 476 ProcessBspViewCells(ray, 477 object,477 reverseSample ? NULL : object, 478 478 faceIndex, 479 479 passContributingSamples, … … 907 907 908 908 // export rays piercing this view cell 909 exporter->ExportRays(vcRays[i], 1000 , RgbColor(0, 1, 0));909 exporter->ExportRays(vcRays[i], 10000, RgbColor(0, 1, 0)); 910 910 911 911 m.mDiffuseColor = RgbColor(1, 0, 0); … … 981 981 982 982 Exporter *exporter = Exporter::GetExporter(s); 983 exporter->SetFilled(); 984 985 ViewCellPvsMap::iterator it = vc->GetPvs().mEntries.begin(); 986 983 987 984 exporter->SetFilled();//Wireframe(); 988 985 … … 1002 999 } 1003 1000 1004 Debug << i << ": pvs size=" << (int)vc->GetPvs().GetSize() << endl; 1001 1002 Debug << i << ": pvs size=" << (int)vc->GetPvs().GetSize() 1003 << ", piercing rays=" << (int)vcRays[i].size() << endl; 1005 1004 1006 1005 1007 1006 // export rays piercing this view cell 1008 exporter->ExportRays(vcRays[i], 1000 0, RgbColor(0, 1, 0));1009 1007 exporter->ExportRays(vcRays[i], 1000, RgbColor(0, 1, 0)); 1008 1010 1009 m.mDiffuseColor = RgbColor(1, 0, 0); 1011 1010 exporter->SetForcedMaterial(m); 1012 1011 1012 ViewCellPvsMap::const_iterator it, 1013 it_end = vc->GetPvs().mEntries.end(); 1014 1013 1015 // output PVS of view cell 1014 for ( ; it != vc->GetPvs().mEntries.end(); ++ it)1016 for (it = vc->GetPvs().mEntries.begin(); it != it_end; ++ it) 1015 1017 { 1016 1018 Intersectable *intersect = (*it).first; 1017 1019 if (!intersect->Mailed()) 1018 1020 { 1021 Material m = RandomMaterial(); 1022 1023 exporter->SetForcedMaterial(m); 1024 1019 1025 exporter->ExportIntersectable(intersect); 1020 1026 intersect->Mail(); -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.cpp
r398 r399 274 274 } 275 275 276 contribution += mViewCell->GetPvs().AddSample(ray->sourceObject.mObject); 276 if (ray->sourceObject.mObject) 277 contribution += mViewCell->GetPvs().AddSample(ray->sourceObject.mObject); 277 278 278 279 if (contribution > 0) … … 281 282 ++ contributingSamples; 282 283 } 283 284 // warning: not ordered 284 // warning: intersections not ordered 285 285 ray->bspIntersections.push_back(Ray::BspIntersection((*it)->mMinT, this)); 286 286 } … … 1392 1392 // assure that we only count a object 1393 1393 // once for the front and once for the back side of the plane 1394 AddToPvs(*ray->intersections[0].mObject, frontData.mPvs, backData.mPvs,1395 1394 IncPvs(*ray->intersections[0].mObject, frontData.mPvs, backData.mPvs, 1395 cf, frontId, backId, frontAndBackId); 1396 1396 } 1397 1397 1398 1398 // the source object in the origin of the ray 1399 AddToPvs(*ray->sourceObject.mObject, frontData.mPvs, backData.mPvs, 1400 cf, frontId, backId, frontAndBackId); 1399 if (ray->sourceObject.mObject) 1400 { 1401 IncPvs(*ray->sourceObject.mObject, frontData.mPvs, backData.mPvs, 1402 cf, frontId, backId, frontAndBackId); 1403 } 1401 1404 1402 1405 // use #rays to approximate volume … … 1429 1432 } 1430 1433 1431 void BspTree:: AddToPvs(Intersectable &obj,1432 1433 1434 1435 1436 1437 1434 void BspTree::IncPvs(Intersectable &obj, 1435 int &frontPvs, 1436 int &backPvs, 1437 const int cf, 1438 const int frontId, 1439 const int backId, 1440 const int frontAndBackId) const 1438 1441 { 1439 1442 if (cf == Ray::COINCIDENT) //TODO: really belongs to no pvs? … … 2311 2314 } 2312 2315 } 2313 if (!ray->sourceObject.mObject->Mailed()) 2314 { 2315 ray->sourceObject.mObject->Mail(); 2316 ++ pvsSize; 2316 if (ray->sourceObject.mObject) 2317 { 2318 if (!ray->sourceObject.mObject->Mailed()) 2319 { 2320 ray->sourceObject.mObject->Mail(); 2321 ++ pvsSize; 2322 } 2317 2323 } 2318 2324 } -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.h
r397 r399 730 730 /** Computes the pvs of the front and back leaf with a given classification. 731 731 */ 732 void AddToPvs(Intersectable &obj,732 void IncPvs(Intersectable &obj, 733 733 int &frontPvs, 734 734 int &backPvs,
Note: See TracChangeset
for help on using the changeset viewer.