Changeset 1732 for GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
- Timestamp:
- 11/09/06 13:36:30 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
r1727 r1732 47 47 mParent(NULL), 48 48 mMailbox(0), 49 mRenderCostDecr(0),50 mMemoryIncr(0),51 mPvsEntriesIncr(0),49 //mRenderCostDecr(0), 50 //mMemoryIncr(0), 51 //mPvsEntriesIncr(0), 52 52 mTimeStamp(0) 53 53 { … … 59 59 mBoundingBox(bbox), 60 60 mMailbox(0), 61 mMemoryIncr(0),62 mRenderCostDecr(0),63 mPvsEntriesIncr(0),61 //mMemoryIncr(0), 62 //mRenderCostDecr(0), 63 //mPvsEntriesIncr(0), 64 64 mTimeStamp(0) 65 65 { … … 71 71 mParent(parent), 72 72 mMailbox(0), 73 mMemoryIncr(0),74 mRenderCostDecr(0),75 mPvsEntriesIncr(0),73 //mMemoryIncr(0), 74 //mRenderCostDecr(0), 75 //mPvsEntriesIncr(0), 76 76 mTimeStamp(0) 77 77 { … … 292 292 Environment::GetSingleton()->GetIntValue("BvHierarchy.maxTests", mMaxTests); 293 293 294 //mUseBboxAreaForSah = false; 295 mUseBboxAreaForSah = true; 294 //mMemoryConst = (float)(sizeof(VspLeaf) + sizeof(VspViewCell)); 295 //mMemoryConst = (float)sizeof(BvhLeaf); 296 mMemoryConst = (float)sizeof(ObjectContainer); 297 cout << "bvh memcost: " << mMemoryConst << endl; 298 cout << "triangle: " << sizeof(TriangleIntersectable) << endl; 299 cout << "triangle: " << sizeof(Intersectable) << endl; 300 cout << "triangle: " << sizeof(ObjectContainer) << endl; 301 cout << "triangle: " << sizeof(float) << endl; 302 cout << "triangle: " << sizeof(int) << endl; 303 304 mUseBboxAreaForSah = true; 296 305 297 306 ///////////// … … 317 326 Debug << "use global sort: " << mUseGlobalSorting << endl; 318 327 Debug << "minimal rays for visibility: " << mMinRaysForVisibility << endl; 328 Debug << "bvh mem const: " << mMemoryConst << endl; 319 329 320 330 Debug << endl; … … 503 513 { 504 514 BvhLeaf *leaf = dynamic_cast<BvhLeaf *>(currentNode); 505 CollectRays(leaf->mObjects, leaf->mVssRays);515 // CollectRays(leaf->mObjects, leaf->mVssRays); 506 516 } 507 517 … … 584 594 // otherwise danger of being stuck in a local minimum! 585 595 const float factor = mRenderCostDecreaseWeight; 586 priority = factor * renderCostDecr + (1.0f - factor) * oldRenderCost; 587 588 if (mHierarchyManager->mConsiderMemory2) 589 { 590 priority /= ((float)splitCandidate.GetPvsEntriesIncr() + mHierarchyManager->mMemoryConst); 596 597 if (1) 598 { 599 priority = factor * renderCostDecr + (1.0f - factor) * oldRenderCost; 600 if (mHierarchyManager->mConsiderMemory2) 601 { 602 priority /= ((float)splitCandidate.GetPvsEntriesIncr() + mMemoryConst); 603 } 604 } 605 else 606 { 607 if (!mHierarchyManager->mConsiderMemory2) 608 { 609 priority = factor * renderCostDecr + (1.0f - factor) * oldRenderCost; 610 } 611 else 612 { 613 const float ratio = 614 renderCostDecr / ((float)splitCandidate.GetPvsEntriesIncr() + mMemoryConst); 615 616 priority = factor * ratio + (1.0f - factor) * oldRenderCost; 617 } 591 618 } 592 619 } … … 2351 2378 //oldNode->mPvsEntriesIncr += sc->GetPvsEntriesIncr(); 2352 2379 2353 oldNode->mRenderCostDecr = sc->GetRenderCostDecrease();2354 oldNode->mPvsEntriesIncr = sc->GetPvsEntriesIncr();2380 //oldNode->mRenderCostDecr = sc->GetRenderCostDecrease(); 2381 //oldNode->mPvsEntriesIncr = sc->GetPvsEntriesIncr(); 2355 2382 2356 2383 ///////////////////////////
Note: See TracChangeset
for help on using the changeset viewer.