Ignore:
Timestamp:
11/01/06 23:20:53 (18 years ago)
Author:
mattausch
Message:

worked on full render cost evaluation
warning: some change sin render cost evaluation for pvs which could have bugs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/Pvs.cpp

    r1703 r1707  
    7979        We eliminate already accounted bvh nodes and objects using mailboxing.  
    8080*/ 
    81 static int EvalBvhNodeContribution(BvhIntersectable *bvhobj) 
     81static float EvalBvhNodeContribution(BvhIntersectable *bvhobj) 
    8282{ 
    83         BvhNode *node= bvhobj->GetItem(); 
     83        BvhLeaf *leaf = bvhobj->GetItem(); 
     84        BvhNode *node = leaf->GetActiveNode(); 
    8485 
    8586        // early exit 
    86         if (node->IsLeaf())      
     87        if (node == leaf)        
    8788        { 
    8889                // objects already accounted for 
    89                 if (node->Mailed()) 
     90                if (leaf->Mailed()) 
    9091                        return 0; 
    9192 
    92                 node->Mail(); 
    93                 BvhLeaf *leaf = dynamic_cast<BvhLeaf *>(node); 
    94                 return (int)leaf->mObjects.size(); 
     93                leaf->Mail(); 
     94                return BvHierarchy::EvalAbsCost(leaf->mObjects); 
    9595        }                         
    9696 
    9797        // compute leaf pvs 
    98         int pvs = 0; 
     98        float pvs = 0; 
    9999        stack<BvhNode *> tStack; 
    100         tStack.push(bvhobj->GetItem()); 
     100        tStack.push(node); 
    101101 
    102102        while (!tStack.empty()) 
    103103        { 
    104                 BvhNode *node = tStack.top(); 
     104                node = tStack.top(); 
    105105                tStack.pop(); 
    106106 
     
    112112                        if (node->IsLeaf()) 
    113113                        { 
    114                                 BvhLeaf *leaf = dynamic_cast<BvhLeaf *>(node); 
     114                                leaf = dynamic_cast<BvhLeaf *>(node); 
    115115 
    116116                                // add #objects exclusivly in this node 
     
    132132 
    133133 
    134 int ObjectPvs::CountObjectsInPvs() const 
     134float ObjectPvs::EvalPvsCost() const 
    135135{ 
    136         int pvs = 0; 
     136        float pvs = 0; 
    137137 
    138138        Intersectable::NewMail(); 
Note: See TracChangeset for help on using the changeset viewer.