- Timestamp:
- 08/28/06 09:45:22 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp
r1287 r1289 1591 1591 rayInf.ComputeRayIntersection(candidatePlane.mAxis, 1592 1592 candidatePlane.mPosition, t); 1593 /* 1594 if (!mUseKdPvsForHeuristics) 1593 1594 switch (mHierarchyManager->GetObjectSpaceSubdivisonType()) 1595 { 1596 case HierarchyManager::NO_OBJ_SUBDIV: 1595 1597 { 1596 1598 // find front and back pvs for origing and termination object 1597 1599 UpdateObjPvsContri(ray->mTerminationObject, cf, pvsFront, pvsBack, totalPvs); 1598 1600 UpdateObjPvsContri(ray->mOriginObject, cf, pvsFront, pvsBack, totalPvs); 1601 1602 break; 1603 } 1604 case HierarchyManager::KD_BASED_OBJ_SUBDIV: 1605 { 1606 break; 1607 } 1608 case HierarchyManager::BV_BASED_OBJ_SUBDIV: 1609 { 1610 BvhLeaf *tLeaf = mHierarchyManager->mBvHierarchy->GetLeaf(ray->mTerminationObject); 1611 BvhLeaf *oLeaf = mHierarchyManager->mBvHierarchy->GetLeaf(ray->mOriginObject); 1612 1613 UpdateBvNodePvsContri(tLeaf, cf, pvsFront, pvsBack, totalPvs); 1614 UpdateBvNodePvsContri(oLeaf, cf, pvsFront, pvsBack, totalPvs); 1615 1616 break; 1617 } 1618 default: 1619 break; 1620 } 1621 1622 /* 1623 if (!mUseKdPvsForHeuristics) 1624 { 1625 1599 1626 } 1600 1627 else … … 1702 1729 1703 1730 void VspTree::UpdateObjPvsContri(Intersectable *obj, 1704 1705 1706 1707 1731 const int cf, 1732 float &frontPvs, 1733 float &backPvs, 1734 float &totalPvs) const 1708 1735 { 1709 1736 if (!obj) return; … … 1750 1777 } 1751 1778 } 1779 1780 1781 void VspTree::UpdateBvhLeafPvsContri(BvhLeaf *leaf, 1782 const int cf, 1783 float &frontPvs, 1784 float &backPvs, 1785 float &totalPvs) const 1786 { 1787 if (!leaf) return; 1788 1789 const int renderCost = (int)leaf->mObjects.size(); 1790 1791 // leaf in no pvs => new 1792 if (!leaf->Mailed() && !leaf->Mailed(1) && !leaf->Mailed(2)) 1793 { 1794 totalPvs += renderCost; 1795 } 1796 1797 // QUESTION matt: is it safe to assume that 1798 // the leaf belongs to no pvs in this case? 1799 //if (cf == Ray::COINCIDENT) return; 1800 1801 if (cf >= 0) // front pvs 1802 { 1803 if (!leaf->Mailed() && !leaf->Mailed(2)) 1804 { 1805 frontPvs += renderCost; 1806 1807 // already in back pvs => in both pvss 1808 if (leaf->Mailed(1)) 1809 leaf->Mail(2); 1810 else 1811 leaf->Mail(); 1812 } 1813 } 1814 1815 if (cf <= 0) // back pvs 1816 { 1817 if (!leaf->Mailed(1) && !obj->Mailed(2)) 1818 { 1819 backPvs += renderCost; 1820 1821 // already in front pvs => in both pvss 1822 if (leaf->Mailed()) 1823 leaf->Mail(2); 1824 else 1825 leaf->Mail(1); 1826 } 1827 } 1828 } 1829 1752 1830 1753 1831 -
GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.h
r1259 r1289 831 831 832 832 */ 833 void UpdateObjPvsContri(Intersectable *obj, 834 const int cf, 835 float &frontPvs, 836 float &backPvs, 837 float &totalPvs) const; 833 void UpdateObjPvsContri( 834 Intersectable *obj, 835 const int cf, 836 float &frontPvs, 837 float &backPvs, 838 float &totalPvs) const; 839 840 void UpdateBvhLeafPvsContri( 841 BvhLeaf *leaf, 842 const int cf, 843 float &frontPvs, 844 float &backPvs, 845 float &totalPvs) const; 846 838 847 839 848 /** See UpdateObjPvsContri.
Note: See TracChangeset
for help on using the changeset viewer.