Ignore:
Timestamp:
11/05/05 12:40:40 (19 years ago)
Author:
mattausch
Message:

worked on pvs heuristics

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/GtpVisibilityPreprocessor/src/X3dExporter.cpp

    r378 r379  
    179179 
    180180void  
    181 X3dExporter::ExportBspViewCellPartition(const BspTree &tree) 
     181X3dExporter::ExportBspViewCellPartition(const BspTree &tree, const int maxPvs) 
    182182{ 
    183183        ViewCellContainer viewCells; 
     
    186186        ViewCellContainer::const_iterator it, it_end = viewCells.end(); 
    187187 
     188 
     189        if (maxPvs == 0) 
     190                mUseForcedMaterial = true; 
     191 
    188192        for (it = viewCells.begin(); it != it_end; ++ it) 
    189193        { 
     194                mForcedMaterial.mDiffuseColor.b = 1.0f; 
     195   
     196                float importance = 0; 
     197 
     198                if (maxPvs > 0) 
     199                        importance = (float)(*it)->GetPvs().GetSize() / (float)maxPvs; 
     200 
     201                mForcedMaterial.mDiffuseColor.r = importance; 
     202                mForcedMaterial.mDiffuseColor.g = 1.0f - mForcedMaterial.mDiffuseColor.r; 
     203                 
    190204                if ((*it)->GetMesh()) 
    191205                        ExportViewCell(*it); 
     
    194208                        PolygonContainer cell; 
    195209                        tree.ConstructGeometry(dynamic_cast<BspViewCell *>(*it), cell); 
     210 
    196211                        ExportPolygons(cell); 
    197212                } 
Note: See TracChangeset for help on using the changeset viewer.