Changeset 578 for trunk/VUT/GtpVisibilityPreprocessor/src/VspBspTree.cpp
- Timestamp:
- 01/25/06 18:28:09 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/VspBspTree.cpp
r576 r578 38 38 float BspMergeCandidate::sOverallCost = 0; 39 39 bool BspMergeCandidate::sUseArea = false; 40 41 42 int BspMergeCandidate::sUpperPvsLimit = 120; 43 int BspMergeCandidate::sLowerPvsLimit = 5; 44 40 45 41 46 … … 400 405 geom); 401 406 402 // first node is kd node 403 tData.mIsKdNode = true; 407 // first node is kd node, i.e. an axis aligned box 408 if (1) 409 tData.mIsKdNode = true; 410 else 411 tData.mIsKdNode = false; 404 412 405 413 tStack.push(tData); … … 1386 1394 { 1387 1395 // try to equalize render differences 1388 const float oldCost = pOverall * (float)totalPvs + Limits::Small; 1389 float newCost = fabs(pvsFront * pFront - pvsBack * pBack); 1396 //const float oldCost = pOverall * (float)totalPvs + Limits::Small; 1397 //float newCost = fabs(pvsFront * pFront - pvsBack * pBack); 1398 const float oldCost = pOverall + Limits::Small; 1399 float newCost = (float)abs(pvsFront - pvsBack); 1390 1400 1391 1401 cost += mPvsFactor * newCost / oldCost; … … 3523 3533 3524 3534 3535 inline float BspMergeCandidate::EvalPvsPenalty(int pvs) const 3536 { 3537 // clamp to minmax values 3538 if (pvs > sUpperPvsLimit) 3539 return (float)sUpperPvsLimit; 3540 if (pvs < sLowerPvsLimit) 3541 return (float)sLowerPvsLimit; 3542 3543 return (float)pvs; 3544 } 3545 3546 3525 3547 void BspMergeCandidate::EvalMergeCost() 3526 3548 { … … 3532 3554 //const int newPvs = diff1 + vc1->GetPvs().GetSize(); 3533 3555 const int newPvs = ComputeMergedPvsSize(vc1->GetPvs(), vc2->GetPvs()); 3556 const float f = EvalPvsPenalty(newPvs); 3534 3557 3535 3558 //-- compute ratio of old cost
Note: See TracChangeset
for help on using the changeset viewer.