- Timestamp:
- 02/01/07 14:42:05 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/scripts/generate_viewcells.env
r2070 r2071 12 12 13 13 Preprocessor { 14 samplesPerPass 300000014 samplesPerPass 3000000 15 15 useGlRenderer false 16 16 type vss … … 19 19 loadMeshes false 20 20 # internal raycaster 21 rayCastMethod 021 # rayCastMethod 0 22 22 # intel raycaster 23 #rayCastMethod 123 rayCastMethod 1 24 24 exportVisibility false 25 25 loadKdTree false … … 190 190 VspBspTree { 191 191 Construction { 192 samples 200000 192 samples 2000000 193 193 epsilon 0.0000001 194 194 randomize false -
GTP/trunk/Lib/Vis/Preprocessing/src/InternalRayCaster.cpp
r2070 r2071 201 201 #endif 202 202 203 AxisAlignedBox3 ebox = sbox; 204 ebox.Enlarge(Vector3(1e-3f)); 205 203 206 SimpleRayContainer::const_iterator sit, sit_end = rays.end(); 204 207 … … 207 210 { 208 211 CastRay(*sit, vssRays, sbox, castDoubleRays, pruneInvalidRays); 209 if (!vssRays.empty() && (!vssRays.back() || ! sbox.IsInside(*vssRays.back())))212 if (!vssRays.empty() && (!vssRays.back() || !ebox.IsInside(*vssRays.back()))) 210 213 cout << "error " << *vssRays.back()<<endl; 211 214 } -
GTP/trunk/Lib/Vis/Preprocessing/src/Mutation.cpp
r2063 r2071 473 473 static Vector3 shifts[packetSize]; 474 474 // mutate the 475 float alpha = RandomValue(0.0f, 2.0f*M_PI);475 float alpha = RandomValue(0.0f, Real(2.0*M_PI)); 476 476 //float alpha = vr2.x*2.0f*M_PI; 477 477 -
GTP/trunk/Lib/Vis/Preprocessing/src/Pvs.h
r2066 r2071 712 712 template <typename T, typename S> 713 713 float Pvs<T, S>::AddSample(T sample, const float pdf) 714 { cout << "t";714 { 715 715 ++ mSamples; 716 716 -
GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp
r2069 r2071 205 205 bool SpatialBoxBasedDistribution::GenerateSample(SimpleRay &ray) 206 206 { 207 Vector3 origin, direction; 208 209 mPreprocessor.mViewCellsManager->GetViewPoint(origin); 210 direction = mPreprocessor.mKdTree->GetBox().GetRandomPoint() - origin; 211 //cout << "z"; 212 const float c = Magnitude(direction); 213 214 if (c <= Limits::Small) 215 return false; 216 217 const float pdf = 1.0f; 218 219 direction *= 1.0f / c; 220 ray = SimpleRay(origin, direction, SPATIAL_BOX_BASED_DISTRIBUTION, pdf); 221 222 return true; 223 224 /* 207 225 Vector3 origin, direction; 208 226 … … 226 244 ray = SimpleRay(origin, direction, SPATIAL_BOX_BASED_DISTRIBUTION, pdf); 227 245 228 return true; 246 return true;*/ 229 247 } 230 248 -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp
r2066 r2071 265 265 float &contribution) 266 266 { 267 cout<<"e";268 267 const bool result = mPvs.AddSample(sample, pdf);//, contribution); 269 268 // have to recompute pvs size -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r2069 r2071 3655 3655 3656 3656 /////////// 3657 //-- faster way of computing pvs: 3658 //-- construct merged pvs by adding 3659 //-- and only those of the next pvs which were not mailed. 3660 //-- note: sumpdf is not correct!! 3657 //-- merge pvss 3661 3658 3662 3659 vector<ObjectPvs>::iterator oit = pvsList.begin(); … … 3666 3663 ObjectPvsIterator pit = (*oit).GetIterator(); 3667 3664 3668 // first mark all object from this pvs3665 // add pvss to new pvs: use mailing to avoid adding entries two times. 3669 3666 while (pit.HasMoreEntries()) 3670 3667 { … … 3677 3674 intersect->Mail(); 3678 3675 3679 if (pvs.AddSampleDirtyCheck(intersect, entry.mData.mSumPdf)) 3680 { 3681 if (pvs.RequiresResort()) 3682 { 3683 pvs.SimpleSort(); 3684 } 3685 } 3686 3676 pvs.AddSampleDirty(intersect, entry.mData.mSumPdf); 3687 3677 } 3688 3678 } 3689 3679 } 3680 3681 if (0) pvs.Sort(); 3690 3682 3691 3683 // store pvs in this node … … 3699 3691 3700 3692 #else 3701 // really merge cells: slow put sumPdf is correct3693 // really merge cells: slow but sumPdf is correct 3702 3694 viewCellInterior->GetPvs().Merge(backVc->GetPvs()); 3703 3695 viewCellInterior->GetPvs().Merge(frontVc->GetPvs()); -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp
r2063 r2071 912 912 } 913 913 if (attrName == "pvs") 914 { //cout <<"e";914 { 915 915 StrX attrValue(attributes.getValue(i)); 916 916 const char *ptr = attrValue.LocalForm(); -
GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp
r2070 r2071 27 27 #define COUNT_ORIGIN_OBJECTS 1 28 28 29 #define STORE_PVS 029 #define STORE_PVS 1 30 30 31 31 … … 959 959 EvalSubdivisionCandidate(backCandidate); 960 960 961 cout << "f cost: " << frontCandidate.mPriority << endl;962 cout << "b cost: " << backCandidate.mPriority << endl;961 cout << "f cost: " << frontCandidate.mPriority << " " << frontCandidate.mRenderCostDecr << endl; 962 cout << "b cost: " << backCandidate.mPriority << " " << backCandidate.mRenderCostDecr << endl; 963 963 tQueue.push(frontCandidate); 964 964 tQueue.push(backCandidate); … … 1273 1273 if (ray->mTerminationObject) 1274 1274 { 1275 cout << "m";1275 //cout << "m"; 1276 1276 if (vc->AddPvsSample(ray->mTerminationObject, ray->mPdf, contribution)) 1277 1277 madeContrib = true;
Note: See TracChangeset
for help on using the changeset viewer.