Ignore:
Timestamp:
12/18/07 09:04:41 (17 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r2569 r2570  
    21012101                if (!ViewCellsConstructed())  
    21022102                { 
    2103                         // view cells not yet constructed 
     2103                        // view cells not constructed yet => 
    21042104                        // just take the lenghts of the rays as contributions 
    21052105                        if ((*it)->mTerminationObject) 
     
    26692669 
    26702670 
     2671void ViewCellsManager::UpdateStatsForViewCell(ViewCell *vc, Intersectable *obj) 
     2672{ 
     2673                KdIntersectable *kdObj = static_cast<KdIntersectable *>(obj); 
     2674 
     2675        const AxisAlignedBox3 box = kdObj->GetBox(); 
     2676                const float dist = SqrDistance(vc->GetBox().Center(), box.Center()); 
     2677 
     2678                float f; 
     2679 
     2680                const float radius = mViewSpaceBox.Radius(); 
     2681                const float fullRadius = mViewSpaceBox.Radius(); 
     2682 
     2683                const float minVal = 0.1f; 
     2684                const float maxVal = 1.0f; 
     2685 
     2686                if (dist <= radius)  
     2687                        f = maxVal; 
     2688                else if (dist >= fullRadius) 
     2689                        f = minVal; 
     2690                else // linear blending 
     2691                { 
     2692                        f = minVal * (dist - radius) + maxVal * (fullRadius - radius - dist); 
     2693                } 
     2694 
     2695                const int numTriangles = kdObj->ComputeNumTriangles(); 
     2696 
     2697                vc->GetPvs().mStats.mDistanceWeightedTriangles += f * numTriangles;  
     2698                vc->GetPvs().mStats.mDistanceWeightedPvs += f; 
     2699                vc->GetPvs().mStats.mWeightedTriangles += numTriangles; 
     2700} 
     2701 
     2702 
    26712703void ViewCellsManager::ComputeViewCellContribution(ViewCell *viewCell, 
    26722704                                                                                                   VssRay &ray,  
     
    26922724                hasAbsContribution = viewCell->GetPvs().AddSampleDirtyCheck(obj, ray.mPdf); 
    26932725                //hasAbsContribution = viewCell->GetPvs().AddSample(obj,ray.mPdf); 
     2726#if 1 
     2727                UpdateStatsForViewCell(viewCell, obj); 
     2728#endif 
     2729 
    26942730        } 
    26952731        else  
Note: See TracChangeset for help on using the changeset viewer.