Changeset 1765 for GTP/trunk/Lib/Vis
- Timestamp:
- 11/18/06 23:15:55 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
r1763 r1765 1542 1542 } 1543 1543 } 1544 1544 1545 #if COUNT_ORIGIN_OBJECTS 1546 1545 1547 if (ray->mOriginObject) 1546 1548 { -
GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.h
r1763 r1765 364 364 public: 365 365 366 /// Rays piercing this leaf.367 //VssRayContainer mVssRays;368 366 /// objects 369 367 ObjectContainer mObjects; 370 /// universal counter371 int mCounter;372 368 373 369 protected: -
GTP/trunk/Lib/Vis/Preprocessing/src/IntersectableWrapper.cpp
r1763 r1765 61 61 { 62 62 // random barycentric coordinates 63 float a = RandomValue(0 ,1);64 float b = RandomValue(0 ,1);65 float c = RandomValue(0 ,1);63 float a = RandomValue(0.0f, 1.0f); 64 float b = RandomValue(0.0f, 1.0f); 65 float c = RandomValue(0.0f, 1.0f); 66 66 67 67 const float sum = a + b + c; … … 95 95 Vector3 &normal) 96 96 { 97 int edge = Random(3);97 const int edge = Random(3); 98 98 99 Vector3 a = mItem.mVertices[edge];100 Vector3 b = mItem.mVertices[(edge + 1) % 3];99 const Vector3 a = mItem.mVertices[edge]; 100 const Vector3 b = mItem.mVertices[(edge + 1) % 3]; 101 101 102 102 const float factor = RandomValue(0.0f, 1.0f); … … 112 112 IntersectableWrapper<KdNode *>(item) 113 113 { 114 114 mBox = box; 115 115 } 116 116 } -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r1757 r1765 934 934 } 935 935 936 boolPreprocessor::GenerateRays(const int number,937 938 936 int Preprocessor::GenerateRays(const int number, 937 const int sampleType, 938 SimpleRayContainer &rays) 939 939 { 940 940 const int startSize = (int)rays.size(); … … 943 943 if (!strategy) 944 944 { 945 return false; 946 } 947 948 for (int i=0; (int)rays.size() - startSize < number; ++ i) 945 return 0; 946 } 947 948 int castRays = 0; 949 950 for (int i = 0; (int)rays.size() - startSize < number; ++ i) 949 951 { 950 952 SimpleRay newRay; … … 954 956 #if 1 955 957 rays.AddRay(newRay); 958 ++ castRays; 956 959 #else 957 960 GenerateRayBundle(rays, newRay, 16, 0); 961 castRays += 16; 958 962 #endif 959 963 } … … 961 965 962 966 delete strategy; 963 return true;967 return castRays; 964 968 } 965 969 -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h
r1740 r1765 121 121 bool ExportKdTree(const string filename); 122 122 123 virtual boolGenerateRays(const int number,124 125 123 virtual int GenerateRays(const int number, 124 const int raysType, 125 SimpleRayContainer &rays); 126 126 127 127 bool GenerateRayBundle(SimpleRayContainer &rayBundle, -
GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.cpp
r1761 r1765 56 56 57 57 58 bool 58 int 59 59 RssPreprocessor::GenerateRays( 60 60 const int number, … … 63 63 ) 64 64 { 65 bool result = false;65 int result = 0; 66 66 67 67 Debug<<"Generate rays...\n"<<flush; … … 71 71 case SamplingStrategy::RSS_SILHOUETTE_BASED_DISTRIBUTION: 72 72 if (mRssTree) { 73 GenerateImportanceRays(mRssTree, number, rays); 74 result = true; 73 result = GenerateImportanceRays(mRssTree, number, rays); 75 74 } 76 75 break; -
GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.h
r1737 r1765 133 133 134 134 /** Redefininition of the get sample rays method from the preprocessor */ 135 bool135 int 136 136 GenerateRays( 137 137 const int number, -
GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp
r1763 r1765 166 166 167 167 object->GetRandomSurfacePoint(point, normal); 168 168 169 direction = origin - point; 169 170 // $$ jb the pdf is yet not correct for all sampling methods! 171 const float c = Magnitude(direction); 172 173 if (c <= Limits::Small) 174 return false; 170 171 // $$ jb the pdf is yet not correct for all sampling methods! 172 const float c = Magnitude(direction); 173 174 if ((c <= Limits::Small) || (DotProd(direction, normal) < 0)) 175 { 176 return false; 177 } 175 178 176 179 // $$ jb the pdf is yet not correct for all sampling methods! … … 178 181 //cout << "p: " << point << " "; 179 182 direction *= 1.0f / c; 183 // a little offset 184 point += direction * 0.01f; 185 180 186 ray = SimpleRay(point, direction, pdf); 181 187 … … 220 226 } 221 227 228 222 229 #if 0 223 230 bool ObjectsInteriorDistribution::GenerateSample(SimpleRay &ray) const -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r1764 r1765 316 316 317 317 // create one third of each type 318 int stype; 319 320 const int numStrategies = 3; 321 322 stype = SamplingStrategy::OBJECT_BASED_DISTRIBUTION; 323 mPreprocessor->GenerateRays(samplesPerPass / numStrategies, sampleType, simpleRays); 324 325 stype = SamplingStrategy::SPATIAL_BOX_BASED_DISTRIBUTION; 326 mPreprocessor->GenerateRays(samplesPerPass / numStrategies, sampleType, simpleRays); 327 328 if (0) 329 { 330 stype = SamplingStrategy::DIRECTION_BASED_DISTRIBUTION; 331 mPreprocessor->GenerateRays(samplesPerPass / numStrategies, sampleType, simpleRays); 332 } 333 334 stype = SamplingStrategy::REVERSE_OBJECT_BASED_DISTRIBUTION; 335 mPreprocessor->GenerateRays(samplesPerPass / numStrategies, sampleType, simpleRays); 318 int castRays = 0; 319 320 vector<int> strategies; 321 322 strategies.push_back(SamplingStrategy::OBJECT_BASED_DISTRIBUTION); 323 strategies.push_back(SamplingStrategy::SPATIAL_BOX_BASED_DISTRIBUTION); 324 strategies.push_back(SamplingStrategy::REVERSE_OBJECT_BASED_DISTRIBUTION); 325 326 const int numRaysPerPass = samplesPerPass / (int)strategies.size(); 327 328 vector<int>::const_iterator iit, iit_end = strategies.end(); 329 330 for (iit = strategies.begin(); iit != iit_end; ++ iit) 331 { 332 int stype = *iit; 333 const int newRays = 334 mPreprocessor->GenerateRays(numRaysPerPass, stype, simpleRays); 335 336 cout << "cast " << newRays << " rays of strategy " << stype << endl; 337 castRays += newRays; 338 } 336 339 337 340 cout << "generated " << samplesPerPass << " samples in " << TimeDiff(startTime, GetTime()) * 1e-3 << " secs" << endl; … … 2708 2711 if (vcValid) 2709 2712 { 2710 m.mDiffuseColor.r = 0. 5f + RandomValue(0.0f, 0.5f);2711 m.mDiffuseColor.g = 0. 5f + RandomValue(0.0f, 0.5f);2712 m.mDiffuseColor.b = 0. 5f + RandomValue(0.f, 0.5f);2713 m.mDiffuseColor.r = 0.2f + RandomValue(0.0f, 0.8f); 2714 m.mDiffuseColor.g = 0.2f + RandomValue(0.0f, 0.8f); 2715 m.mDiffuseColor.b = 0.2f + RandomValue(0.0f, 0.8f); 2713 2716 } 2714 2717 else … … 2753 2756 // special color code for invalid view cells 2754 2757 m.mDiffuseColor.r = importance; 2755 m.mDiffuseColor.g = 1.0f - m.mDiffuseColor.r;2756 m.mDiffuseColor.b = vcValid ? 1.0f : 0.0f;2758 m.mDiffuseColor.g = vcValid ? 0.0f : 1.0f; 2759 m.mDiffuseColor.b = 1.0f - importance; 2757 2760 2758 2761 //Debug << "importance: " << importance << endl; … … 5435 5438 Exporter *exporter = Exporter::GetExporter("final_view_cells.wrl"); 5436 5439 5437 Vector3 scale( 1.0f, 0.9f, 1.0f);5440 Vector3 scale(0.9f, 0.9f, 0.9f); 5438 5441 if (exporter) 5439 5442 { -
GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp
r1727 r1765 41 41 42 42 // pvs penalty can be different from pvs size 43 inline static float EvalPvsPenalty(const int pvs,44 const int lower,45 const int upper)43 inline static float EvalPvsPenalty(const float pvs, 44 const float lower, 45 const float upper) 46 46 { 47 47 // clamp to minmax values … … 2267 2267 AddObjToPvs((*rit).mRay->mTerminationObject, side, pvsFront, pvsBack, pvsTotal); 2268 2268 2269 if (COUNT_ORIGIN_OBJECTS) 2269 if (COUNT_ORIGIN_OBJECTS) 2270 { 2270 2271 AddObjToPvs((*rit).mRay->mOriginObject, side, pvsFront, pvsBack, pvsTotal); 2272 } 2271 2273 } 2272 2274 -
GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp
r1764 r1765 40 40 41 41 // pvs penalty can be different from pvs size 42 inline static float EvalPvsPenalty(const int pvs,43 const int lower,44 const int upper)42 inline static float EvalPvsPenalty(const float pvs, 43 const float lower, 44 const float upper) 45 45 { 46 46 // clamp to minmax values … … 734 734 735 735 mTotalCost -= sc->GetRenderCostDecrease(); 736 mTotalPvsSize += tFrontData.mPvs + tBackData.mPvs - tData.mPvs;736 mTotalPvsSize += (int)(tFrontData.mPvs + tBackData.mPvs - tData.mPvs); 737 737 mPvsEntries += sc->GetPvsEntriesIncr(); 738 738 … … 932 932 933 933 //-- compute pvs 934 frontData.mPvs = EvalPvs Size(*frontData.mRays);935 backData.mPvs = EvalPvs Size(*backData.mRays);934 frontData.mPvs = EvalPvsCost(*frontData.mRays); 935 backData.mPvs = EvalPvsCost(*backData.mRays); 936 936 937 937 //-- split front and back node geometry and compute area … … 1120 1120 1121 1121 1122 int VspTree::PrepareHeuristics(KdLeaf *leaf)1122 float VspTree::PrepareHeuristics(KdLeaf *leaf) 1123 1123 { 1124 int pvsSize = 0;1124 float pvsSize = 0; 1125 1125 1126 1126 if (!leaf->Mailed()) … … 1160 1160 1161 1161 1162 int VspTree::PrepareHeuristics(const RayInfoContainer &rays)1162 float VspTree::PrepareHeuristics(const RayInfoContainer &rays) 1163 1163 { 1164 1164 Intersectable::NewMail(); … … 1166 1166 BvhLeaf::NewMail(); 1167 1167 1168 int pvsSize = 0;1168 float pvsSize = 0; 1169 1169 1170 1170 RayInfoContainer::const_iterator ri, ri_end = rays.end(); … … 1243 1243 1244 1244 void VspTree::EvalHeuristics(const SortableEntry &ci, 1245 int &pvsLeft,1246 int &pvsRight) const1245 float &pvsLeft, 1246 float &pvsRight) const 1247 1247 { 1248 1248 VssRay *ray = ci.ray; … … 1251 1251 if (ci.type == SortableEntry::ERayMin) 1252 1252 { 1253 pvsLeft += EvalMinEventContribution(*ray, true); 1253 1254 #if COUNT_ORIGIN_OBJECTS 1254 pvsLeft += EvalMinEventContribution(*ray, true);1255 #else1256 1255 pvsLeft += EvalMinEventContribution(*ray, false); 1257 1256 #endif … … 1259 1258 else // eval changes in pvs causes by max event 1260 1259 { 1260 pvsRight -= EvalMaxEventContribution(*ray, true); 1261 1261 #if COUNT_ORIGIN_OBJECTS 1262 pvsRight -= EvalMaxEventContribution(*ray, true);1263 #else1264 1262 pvsRight -= EvalMaxEventContribution(*ray, false); 1265 1263 #endif … … 1271 1269 const AxisAlignedBox3 &box, 1272 1270 const int axis, 1273 float &position) 1274 { 1275 // get subset of rays 1276 RayInfoContainer randomRays; 1277 randomRays.reserve(mMaxTests); 1278 1279 RayInfoContainer *usedRays; 1280 1281 if (mMaxTests < (int)tData.mRays->size()) 1282 { 1283 GetRayInfoSets(*tData.mRays, mMaxTests, randomRays); 1284 usedRays = &randomRays; 1285 } 1286 else 1287 { 1288 usedRays = tData.mRays; 1289 } 1290 1271 float &position, 1272 const RayInfoContainer &usedRays) 1273 { 1291 1274 const float minBox = box.Min(axis); 1292 1275 const float maxBox = box.Max(axis); … … 1297 1280 const float maxBand = minBox + mMaxBand * sizeBox; 1298 1281 1299 SortSubdivisionCandidates( *usedRays, axis, minBand, maxBand);1282 SortSubdivisionCandidates(usedRays, axis, minBand, maxBand); 1300 1283 1301 1284 // prepare the sweep 1302 1285 // note: returns pvs size => no need t give pvs size as function parameter 1303 const int pvsSize = PrepareHeuristics(*usedRays);1286 const float pvsCost = PrepareHeuristics(usedRays); 1304 1287 1305 1288 // go through the lists, count the number of objects left and right … … 1307 1290 // C = ct_div_ci + (ql*rl + qr*rr)/queries 1308 1291 1309 int pvsl = 0;1310 int pvsr = pvsSize;1311 1312 int pvsBack = pvsl;1313 int pvsFront = pvsr;1314 1315 float sum = (float)pvsSize* sizeBox;1292 float pvsl = 0; 1293 float pvsr = pvsCost; 1294 1295 float pvsBack = pvsl; 1296 float pvsFront = pvsr; 1297 1298 float sum = pvsCost * sizeBox; 1316 1299 float minSum = 1e20f; 1317 1300 … … 1327 1310 BvhLeaf::NewMail(); 1328 1311 1329 //-- traverse through visibility events 1330 vector<SortableEntry>::const_iterator ci, ci_end = mLocalSubdivisionCandidates->end(); 1331 1332 #ifdef GTPGTP_DEBUG 1333 const float volRatio = tData.mBoundingBox.GetVolume() / (sizeBox * mBoundingBox.GetVolume()); 1312 const float volRatio = 1313 tData.mBoundingBox.GetVolume() / (sizeBox * mBoundingBox.GetVolume()); 1314 1315 //////// 1316 //-- iterate through visibility events 1317 1318 vector<SortableEntry>::const_iterator ci, 1319 ci_end = mLocalSubdivisionCandidates->end(); 1320 1321 #ifdef GTP_DEBUG 1334 1322 const int leaves = mVspStats.Leaves(); 1335 1323 const bool printStats = ((axis == 0) && (leaves > 0) && (leaves < 90)); … … 1370 1358 sum = pvsl * ((*ci).value - minBox) + pvsr * (maxBox - (*ci).value); 1371 1359 1372 #ifdef GTP GTP_DEBUG1360 #ifdef GTP_DEBUG 1373 1361 if (printStats) 1374 1362 { … … 1404 1392 //-- compute cost 1405 1393 1406 const int lowerPvsLimit =mViewCellsManager->GetMinPvsSize();1407 const int upperPvsLimit =mViewCellsManager->GetMaxPvsSize();1394 const float lowerPvsLimit = (float)mViewCellsManager->GetMinPvsSize(); 1395 const float upperPvsLimit = (float)mViewCellsManager->GetMaxPvsSize(); 1408 1396 1409 1397 const float pOverall = sizeBox; … … 1411 1399 const float pFront = maxBox - position; 1412 1400 1413 const float penaltyOld = EvalPvsPenalty(pvs Size, lowerPvsLimit, upperPvsLimit);1401 const float penaltyOld = EvalPvsPenalty(pvsCost, lowerPvsLimit, upperPvsLimit); 1414 1402 const float penaltyFront = EvalPvsPenalty(pvsFront, lowerPvsLimit, upperPvsLimit); 1415 1403 const float penaltyBack = EvalPvsPenalty(pvsBack, lowerPvsLimit, upperPvsLimit); … … 1423 1411 } 1424 1412 1425 #ifdef GTPGTP_DEBUG1426 Debug << "\n§§§§ eval local cost §§§§" << endl1413 //#ifdef GTP_DEBUG 1414 cout << "\n((((( eval local cost )))))" << endl 1427 1415 << "back pvs: " << penaltyBack << " front pvs: " << penaltyFront << " total pvs: " << penaltyOld << endl 1428 1416 << "back p: " << pBack * volRatio << " front p " << pFront * volRatio << " p: " << pOverall * volRatio << endl 1429 1417 << "old rc: " << oldRenderCost * volRatio << " new rc: " << newRenderCost * volRatio << endl 1430 1418 << "render cost decrease: " << oldRenderCost * volRatio - newRenderCost * volRatio << endl; 1431 #endif1419 //#endif 1432 1420 return ratio; 1433 1421 } … … 1454 1442 mOnlyDrivingAxis || mCirculatingAxis; 1455 1443 1444 // get subset of rays 1445 RayInfoContainer randomRays; 1446 randomRays.reserve(mMaxTests); 1447 1448 RayInfoContainer *usedRays; 1449 1450 if (mMaxTests < (int)tData.mRays->size()) 1451 { 1452 GetRayInfoSets(*tData.mRays, mMaxTests, randomRays); 1453 usedRays = &randomRays; 1454 } 1455 else 1456 { 1457 usedRays = tData.mRays; 1458 } 1459 1456 1460 if (mCirculatingAxis) 1457 1461 { … … 1460 1464 1461 1465 if (parent) 1466 { 1462 1467 parentAxis = dynamic_cast<VspInterior *>(parent)->GetAxis(); 1468 } 1463 1469 1464 1470 sAxis = (parentAxis + 1) % 3; … … 1476 1482 { 1477 1483 //-- place split plane using heuristics 1484 1478 1485 nCostRatio[axis] = 1479 1486 EvalLocalCostHeuristics(tData, 1480 1487 box, 1481 1488 axis, 1482 nPosition[axis]); 1489 nPosition[axis], 1490 *usedRays); 1483 1491 } 1484 1492 else 1485 1493 { 1486 1494 //-- split plane position is spatial median 1495 1487 1496 nPosition[axis] = (box.Min()[axis] + box.Max()[axis]) * 0.5f; 1488 1497 nCostRatio[axis] = EvalLocalSplitCost(tData, … … 1505 1514 } 1506 1515 1507 ///////////////////////// ///////1516 ///////////////////////// 1508 1517 //-- assign values of best split 1509 1518 … … 1571 1580 1572 1581 1573 /////////////////// /////////////////1582 /////////////////// 1574 1583 //-- evaluate render cost heuristics 1575 1584 1576 const int lowerPvsLimit =mViewCellsManager->GetMinPvsSize();1577 const int upperPvsLimit =mViewCellsManager->GetMaxPvsSize();1578 1579 const float penaltyOld = EvalPvsPenalty( (int)totalPvs, lowerPvsLimit, upperPvsLimit);1580 const float penaltyFront = EvalPvsPenalty( (int)pvsFront, lowerPvsLimit, upperPvsLimit);1581 const float penaltyBack = EvalPvsPenalty( (int)pvsBack, lowerPvsLimit, upperPvsLimit);1585 const float lowerPvsLimit = (float)mViewCellsManager->GetMinPvsSize(); 1586 const float upperPvsLimit = (float)mViewCellsManager->GetMaxPvsSize(); 1587 1588 const float penaltyOld = EvalPvsPenalty(totalPvs, lowerPvsLimit, upperPvsLimit); 1589 const float penaltyFront = EvalPvsPenalty(pvsFront, lowerPvsLimit, upperPvsLimit); 1590 const float penaltyBack = EvalPvsPenalty(pvsBack, lowerPvsLimit, upperPvsLimit); 1582 1591 1583 1592 const float oldRenderCost = pOverall * penaltyOld; … … 1590 1599 const float renderCostDecrease = (oldRenderCost - newRenderCost) / viewSpaceVol; 1591 1600 1592 #ifdef GTP GTP_DEBUG1601 #ifdef GTP_DEBUG 1593 1602 Debug << "\nvsp render cost decrease" << endl 1594 1603 << "back pvs: " << pvsBack << " front pvs " << pvsFront << " total pvs: " << totalPvs << endl … … 1619 1628 KdLeaf::NewMail(3); 1620 1629 1621 const int pvsSize = data.mPvs;1630 const float pvsSize = data.mPvs; 1622 1631 RayInfoContainer::const_iterator rit, rit_end = data.mRays->end(); 1623 1632 … … 1863 1872 if (data.mPvs > mVspStats.maxPvs) 1864 1873 { 1865 mVspStats.maxPvs = data.mPvs;1866 } 1867 1868 mVspStats.pvs += data.mPvs;1874 mVspStats.maxPvs = (int)data.mPvs; 1875 } 1876 1877 mVspStats.pvs += (int)data.mPvs; 1869 1878 1870 1879 if (data.mDepth < mVspStats.minDepth) … … 2215 2224 2216 2225 2217 int VspTree::EvalPvsSize(const RayInfoContainer &rays) const2218 { 2219 int pvsSize= 0;2226 float VspTree::EvalPvsCost(const RayInfoContainer &rays) const 2227 { 2228 float pvsCost = 0; 2220 2229 2221 2230 Intersectable::NewMail(); … … 2228 2237 { 2229 2238 VssRay *ray = (*rit).mRay; 2239 2240 pvsCost += EvalContributionToPvs(*ray, true); 2241 2230 2242 #if COUNT_ORIGIN_OBJECTS 2231 pvsSize += EvalContributionToPvs(*ray, true); 2232 #else 2233 pvsSize += EvalContributionToPvs(*ray, false); 2243 pvsCost += EvalContributionToPvs(*ray, false); 2234 2244 #endif 2235 2245 } 2236 2246 2237 return pvs Size;2247 return pvsCost; 2238 2248 } 2239 2249 … … 2307 2317 { 2308 2318 VssRay *ray = (*rit).mRay; 2319 2320 pvsSize += EvalPvsEntriesContribution(*ray, true); 2321 2309 2322 #if COUNT_ORIGIN_OBJECTS 2310 pvsSize += EvalPvsEntriesContribution(*ray, true);2311 #else2312 2323 pvsSize += EvalPvsEntriesContribution(*ray, false); 2313 2324 #endif … … 2890 2901 2891 2902 /// collect pvs from rays 2892 const int pvsSize = EvalPvsSize(rays);2903 const float pvsCost = EvalPvsCost(rays); 2893 2904 2894 2905 // root and bounding box were already constructed … … 2901 2912 2902 2913 // first vsp traversal data 2903 VspTraversalData vData(leaf, 0, &rays, pvs Size, prop, mBoundingBox);2914 VspTraversalData vData(leaf, 0, &rays, pvsCost, prop, mBoundingBox); 2904 2915 2905 2916 … … 2923 2934 leaf->SetSubdivisionCandidate(splitCandidate); 2924 2935 2925 mTotalCost = (float)pvsSize;2936 mTotalCost = pvsCost; 2926 2937 mPvsEntries = EvalPvsEntriesSize(rays); 2927 2938 … … 3057 3068 3058 3069 3059 int VspTree::PrepareHeuristics(const VssRay &ray, const bool isTermination)3060 { 3061 int pvsSize = 0;3070 float VspTree::PrepareHeuristics(const VssRay &ray, const bool isTermination) 3071 { 3072 float pvsSize = 0; 3062 3073 3063 3074 Intersectable *obj; -
GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.h
r1764 r1765 384 384 const int depth, 385 385 RayInfoContainer *rays, 386 const int pvs,386 const float pvs, 387 387 const float p, 388 388 const AxisAlignedBox3 &box): … … 441 441 AxisAlignedBox3 mBoundingBox; 442 442 /// pvs size 443 int mPvs;443 float mPvs; 444 444 /// how often this branch has missed the max-cost ratio 445 445 int mMaxCostMisses; … … 817 817 float maxBand); 818 818 819 /** Evaluate pvs size as induced by the samples.820 */ 821 int EvalPvsSize(const RayInfoContainer &rays) const;819 /** Evaluate render cost of this pvs. 820 */ 821 float EvalPvsCost(const RayInfoContainer &rays) const; 822 822 823 823 int EvalPvsEntriesIncr(VspSubdivisionCandidate &splitCandidate) const; … … 826 826 */ 827 827 int EvalPvsEntriesSize(const RayInfoContainer &rays) const; 828 828 829 int EvalPvsEntriesContribution(const VssRay &ray, const bool isTermination) const; 830 829 831 /** Computes best cost for axis aligned planes. 830 832 */ … … 832 834 const AxisAlignedBox3 &box, 833 835 const int axis, 834 float &position); 836 float &position, 837 const RayInfoContainer &usedRays); 835 838 836 839 … … 843 846 @param rightPvs updates the right pvs 844 847 */ 845 void EvalHeuristics(const SortableEntry &ve, int &pvsLeft, int &pvsRight) const;848 void EvalHeuristics(const SortableEntry &ve, float &pvsLeft, float &pvsRight) const; 846 849 847 850 /** Evaluates contribution of min event to pvs … … 865 868 @returns pvs size as seen by the rays. 866 869 */ 867 int PrepareHeuristics(const RayInfoContainer &rays);870 float PrepareHeuristics(const RayInfoContainer &rays); 868 871 869 872 /** Prepare a single ray for heuristics. 870 873 */ 871 int PrepareHeuristics(const VssRay &ray, const bool isTermination); 874 float PrepareHeuristics(const VssRay &ray, const bool isTermination); 875 872 876 /** Prepare a single kd leaf for heuristics. 873 877 */ 874 int PrepareHeuristics(KdLeaf *leaf);878 float PrepareHeuristics(KdLeaf *leaf); 875 879 876 880
Note: See TracChangeset
for help on using the changeset viewer.