Changeset 1006 for GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp
- Timestamp:
- 06/09/06 01:26:46 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp
r1004 r1006 124 124 Environment::GetSingleton()->GetIntValue("VspBspTree.nodePriorityQueueType", mNodePriorityQueueType); 125 125 126 Environment::GetSingleton()->GetBoolValue("ViewCells.PostProcess.emptyViewCellsMerge", mEmptyViewCellsMergeAllowed);127 126 128 127 char subdivisionStatsLog[100]; … … 132 131 Environment::GetSingleton()->GetFloatValue("VspBspTree.Construction.minBand", mMinBand); 133 132 Environment::GetSingleton()->GetFloatValue("VspBspTree.Construction.maxBand", mMaxBand); 134 Environment::GetSingleton()->GetBoolValue("VspBspTree.Construction.useDrivingAxisForMaxCost", mUseDrivingAxis ForMaxCost);133 Environment::GetSingleton()->GetBoolValue("VspBspTree.Construction.useDrivingAxisForMaxCost", mUseDrivingAxisIfMaxCostViolated); 135 134 136 135 //-- debug output … … 161 160 Debug << "use random axis: " << mUseRandomAxis << endl; 162 161 Debug << "priority queue type: " << mNodePriorityQueueType << endl; 163 Debug << "empty view cells merge: " << mEmptyViewCellsMergeAllowed << endl;164 162 Debug << "circulating axis: " << mCirculatingAxis << endl; 165 163 Debug << "minband: " << mMinBand << endl; 166 164 Debug << "maxband: " << mMaxBand << endl; 167 Debug << "use driving axis for max cost: " << mUseDrivingAxis ForMaxCost<< endl;165 Debug << "use driving axis for max cost: " << mUseDrivingAxisIfMaxCostViolated << endl; 168 166 169 167 Debug << "Split plane strategy: "; … … 1194 1192 } 1195 1193 1196 if (ray->mOriginObject) 1194 // only count termination objects? 1195 if (1 && ray->mOriginObject) 1197 1196 { 1198 1197 if (vc->AddPvsSample(ray->mOriginObject, ray->mPdf, contribution)) … … 1482 1481 const float maxCostRatioForArbitraryAxis = 0.9f; 1483 1482 1484 if (mUseDrivingAxis ForMaxCost)1483 if (mUseDrivingAxisIfMaxCostViolated) 1485 1484 bestAxis = box.Size().DrivingAxis(); 1486 1485 else … … 1523 1522 nPosition[axis]); 1524 1523 } 1525 1526 //-- split plane position is spatial median 1527 1528 1529 // also use median split if cost ratio very low as 1530 // there are not enough visibility cues 1531 //if (!mUseCostHeuristics || (nCostRatio[axis] > maxCostRatioForHeur)) 1532 else 1524 else //-- split plane position is spatial median 1533 1525 { 1534 1526 … … 1578 1570 1579 1571 1580 if (mUseDrivingAxis ForMaxCost)1572 if (mUseDrivingAxisIfMaxCostViolated) 1581 1573 { 1582 1574 // we take longest axis split if cost ratio exceeds threshold … … 1710 1702 } 1711 1703 1704 1712 1705 //-- evaluate axis aligned splits 1706 1713 1707 int axis; 1714 1708 BspNodeGeometry *fGeom, *bGeom; … … 1717 1711 candidateCost = 99999999.0f; 1718 1712 1719 // option: axis aligned split only if no polygon available 1713 // as a variant, we take axis aligned split only if there is 1714 // more polygon available to guide the split 1720 1715 if (!mUsePolygonSplitIfAvailable || data.mPolygons->empty()) 1721 1716 { … … 1932 1927 1933 1928 #if 1 1934 // take render cost of node into account 1929 // take render cost of node into account to avoid being stuck in a local minimum 1935 1930 const float normalizedOldRenderCost = oldRenderCost / mBox.GetVolume(); 1931 1936 1932 //Debug << "rendercostdecr: " << 0.99f * renderCostDecrease << " old render cost: " << 0.01f * normalizedOldRenderCost << endl; 1937 //return 0.5f * renderCostDecrease + 0.5f * normalizedOldRenderCost;1938 1933 return 0.99f * renderCostDecrease + 0.01f * normalizedOldRenderCost; 1939 1934 #else … … 1956 1951 float pvsBack = 0; 1957 1952 1953 // overall probability is used as normalizer 1954 float pOverall = 0; 1955 1958 1956 // probability that view point lies in back / front node 1959 float pOverall = 0;1960 1957 pFront = 0; 1961 1958 pBack = 0; … … 3532 3529 3533 3530 3534 typedef pair<BspNode *, BspNodeGeometry *> bspNodePair;3535 3536 3537 3531 int VspBspTree::CastBeam(Beam &beam) 3538 3532 { … … 3656 3650 MergeCandidate mc(leaf->GetViewCell(), (*nit)->GetViewCell()); 3657 3651 3658 // dont't merge view cells if they are empty and not front and back leaf of the same parent 3659 // in the tree? 3660 if (mEmptyViewCellsMergeAllowed || 3661 !leaf->GetViewCell()->GetPvs().Empty() || 3652 if (!leaf->GetViewCell()->GetPvs().Empty() || 3662 3653 !(*nit)->GetViewCell()->GetPvs().Empty() || 3663 3654 leaf->IsSibling(*nit))
Note: See TracChangeset
for help on using the changeset viewer.