Changeset 605 for trunk/VUT/GtpVisibilityPreprocessor/src/VspBspTree.cpp
- Timestamp:
- 02/08/06 15:05:04 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/VspBspTree.cpp
r604 r605 67 67 mOutOfBoundsCell(NULL), 68 68 mStoreRays(false), 69 mRenderCostWeight(0.5) 69 mRenderCostWeight(0.5), 70 mUseRandomAxis(false) 70 71 { 71 72 bool randomize = false; … … 429 430 tQueue.push(tData); 430 431 431 mTotalCost = tData. GetCost()/ mBox.GetVolume();432 mTotalCost = tData.mPvs * tData.mProbability / mBox.GetVolume(); 432 433 433 434 mSubdivisionStats 434 << "# Leaves\n1\n" << endl435 << "#ViewCells\n1\n" << endl 435 436 << "#RenderCostDecrease\n0\n" << endl 436 437 << "#TotalRenderCost\n" << mTotalCost << endl; … … 528 529 if (1) 529 530 { 531 float cFront = tFrontData.mPvs * tFrontData.mProbability; 532 float cBack = tBackData.mPvs * tBackData.mProbability; 533 float cData = tData.mPvs * tData.mProbability;; 534 530 535 float costDecr = 531 ( tFrontData.GetCost() + tBackData.GetCost() - tData.GetCost()) / mBox.GetVolume();536 (cFront + cBack - cData) / mBox.GetVolume(); 532 537 mTotalCost += costDecr; 533 538 534 539 mSubdivisionStats 535 << "# Leaves\n" << mBspStats.Leaves() << endl540 << "#ViewCells\n" << mBspStats.Leaves() << endl 536 541 << "#RenderCostDecrease\n" << -costDecr << endl 537 542 << "#TotalRenderCost\n" << mTotalCost << endl; … … 957 962 } 958 963 959 const int sAxis = box.Size().DrivingAxis();964 const int sAxis = mUseRandomAxis ? Random(3) : box.Size().DrivingAxis(); 960 965 961 966 for (axis = 0; axis < 3; ++ axis)
Note: See TracChangeset
for help on using the changeset viewer.