Ignore:
Timestamp:
12/19/06 11:09:01 (18 years ago)
Author:
mattausch
Message:

added support for pvs correction (warning: does not yet compile)

File:
1 edited

Legend:

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

    r1904 r1911  
    734734 
    735735 
     736float HierarchyManager::EvalPvsCorrectionFactor(const float childPvs,  
     737                                                                                                const float totalPvs,  
     738                                                                                                const float avgRayContri) const 
     739{ 
     740        if (!childPvs || 
     741                // assume pvs sampled sufficiently => take child pvs 
     742                (avgRayContri < mMinAvgRayContri)) 
     743                return 1.0f; 
     744 
     745        // assume pvs not sampled sufficiently => take total pvs 
     746        if (avgRayContri > mMaxAvgRayContri) 
     747                return totalPvs / childPvs; 
     748 
     749        const float factor =  
     750                        (mMaxAvgRayContri - avgRayContri) /  
     751                        (mMaxAvgRayContri - mMinAvgRayContri); 
     752 
     753        const float newPvs = factor * childPvs + (1.0f - factor) * totalPvs;     
     754         
     755        return newPvs / childPvs; 
     756} 
     757 
     758 
    736759bool HierarchyManager::ApplySubdivisionCandidate(SubdivisionCandidate *sc,  
    737760                                                                                                 SplitQueue &splitQueue, 
     
    780803        // high avg ray contri, the result is influenced by undersampling 
    781804        // => decrease priority 
    782         if (USE_AVGRAYCONTRI && (sc->GetAvgRayContribution() > mMaxAvgRayContri)) 
     805        if (0 && USE_AVGRAYCONTRI && (sc->GetAvgRayContribution() > mMaxAvgRayContri)) 
    783806        { 
    784807                const float factor = 1.0f + sc->GetAvgRayContribution() - mMaxAvgRayContri; 
Note: See TracChangeset for help on using the changeset viewer.