Ignore:
Timestamp:
11/04/05 03:47:27 (19 years ago)
Author:
mattausch
Message:
 
Location:
trunk/VUT/GtpVisibilityPreprocessor/src
Files:
5 edited

Legend:

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

    r376 r378  
    11651165                 "bspTree"); 
    11661166 
    1167   RegisterOption("ViewCells.minPvsDif", 
     1167  RegisterOption("ViewCells.PostProcessing.minPvsDif", 
     1168                 optInt, 
     1169                 "-view_cells_min_pvs_dif", 
     1170                 "10"); 
     1171   
     1172  RegisterOption("ViewCells.PostProcessing.maxPvs", 
     1173                 optInt, 
     1174                 "-view_cells_max_pvs", 
     1175                 "300"); 
     1176 
     1177  RegisterOption("ViewCells.PostProcessing.minPvs", 
    11681178                 optString, 
    1169                  "-view_cells_min_pvs_dif", 
     1179                 "-view_cells_min_pvs", 
    11701180                 "10"); 
    11711181 
     
    11901200          "100000"); 
    11911201 
    1192   RegisterOption("BspTree.PostProcessing.samples", 
     1202  RegisterOption("ViewCells.PostProcessing.samples", 
    11931203          optInt, 
    11941204          "-bsp_postprocessing_samples=", 
  • trunk/VUT/GtpVisibilityPreprocessor/src/SamplingPreprocessor.cpp

    r375 r378  
    1414  environment->GetIntValue("Sampling.totalSamples", mTotalSamples); 
    1515  environment->GetIntValue("BspTree.Construction.samples", mBspConstructionSamples); 
    16   environment->GetIntValue("BspTree.PostProcessing.samples", mPostProcessSamples); 
     16  environment->GetIntValue("ViewCells.PostProcessing.samples", mPostProcessSamples); 
    1717  mKdPvsDepth = 100; 
    1818  mStats.open("stats.log"); 
     
    531531                cout << "#totalPvsSize=" << mKdTree->CollectLeafPvs() << endl; 
    532532   
    533         //-- post processing of bsp view cells 
    534533        if (mBspTree) 
    535534        { 
    536                 int vcSize = 0; 
     535                //-- render simulation 
     536                cout << "\nevaluating render time before merge ... "; 
     537                Real rt = SimulateRendering(); 
     538                 
     539                cout << "avg render time: " << rt * 1e-3 << endl; 
     540                Debug << "avg render time: " << rt * 1e-3 << endl; 
     541 
     542                //-- post processing of bsp view cells 
     543        int vcSize = 0; 
    537544                int pvsSize = 0; 
    538545 
     
    553560                         << TimeDiff(startTime, GetTime()) *1e-3 << " secs" << endl; 
    554561 
    555                 cout << "evaluating render time heuristics ... "; 
    556  
    557562                //-- recount pvs 
    558563                mBspTree->EvaluateViewCellsStats(stat); 
     
    560565                Debug << "after post processing:\n" << stat << endl; 
    561566 
    562                 Real rt = SimulateRendering(); 
    563                 cout << "finished" << endl; 
    564  
     567                //-- render simulation 
     568                cout << "\nevaluating render time after merge ... "; 
     569                         
     570                rt = SimulateRendering(); 
     571 
     572                cout << "render time: " << rt * 1e-3 << endl; 
    565573                Debug << "render time: " << rt * 1e-3 << endl; 
    566574        } 
     
    917925 
    918926 
    919  
    920927Real SamplingPreprocessor::RenderPvs(ViewCell &viewCell,  
    921928                                                                         const float objRenderTime) const 
     
    959966        renderTime /= totalArea; 
    960967 
     968        Debug << "render time without overhead: " << renderTime * 1e-3 << endl; 
     969         
    961970        renderTime += (float)viewCells.size() * vcOverhead; 
    962          
     971 
    963972        return renderTime; 
    964973} 
  • trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.cpp

    r375 r378  
    2424int BspTree::sTermMaxRays = -1; 
    2525int BspTree::sMinPvsDif = 10; 
     26int BspTree::sMinPvs = 10; 
     27int BspTree::sMaxPvs = 500; 
    2628 
    2729float BspTree::sCt_div_ci = 1.0f; 
     
    349351        app << setprecision(4); 
    350352 
     353        app << "#N_OVERALLPVS ( objects in PVS )\n" << pvs << endl; 
     354 
    351355        app << "#N_PMAXPVS ( largest PVS )\n" << maxPvs << endl; 
    352356 
     
    14821486        Vector3::sDistToleranceSqrt = Vector3::sDistTolerance * Vector3::sDistTolerance; 
    14831487 
    1484         environment->GetIntValue("ViewCells.minPvsDif", sMinPvsDif); 
     1488        // post processing stuff 
     1489        environment->GetIntValue("ViewCells.PostProcessing.minPvsDif", sMinPvsDif); 
     1490        environment->GetIntValue("ViewCells.PostProcessing.minPvs", sMinPvs); 
     1491        environment->GetIntValue("ViewCells.PostProcessing.maxPvs", sMaxPvs); 
    14851492 
    14861493    Debug << "BSP max depth: " << sTermMaxDepth << endl; 
     
    18141821                return false; 
    18151822 
    1816         /*Debug << "merge (" << sMinPvsDif << ")" << endl; 
    1817         Debug << "size f: " << fvc->GetPvs().GetSize() << ", " 
    1818                   << "size b: " << bvc->GetPvs().GetSize() << endl; 
    1819          
    1820         Debug << "diff f: " << fvc->GetPvs().Diff(bvc->GetPvs()) << ", " 
    1821                   << "diff b: " << bvc->GetPvs().Diff(fvc->GetPvs()) << endl;*/ 
    1822  
    1823     if ((fvc->GetPvs().Diff(bvc->GetPvs()) < sMinPvsDif) && 
    1824             (bvc->GetPvs().Diff(fvc->GetPvs()) < sMinPvsDif)) 
    1825                 return true; 
    1826  
     1823        int fdiff = fvc->GetPvs().Diff(bvc->GetPvs()); 
     1824 
     1825        if (fvc->GetPvs().GetSize() + fdiff < sMaxPvs) 
     1826        { 
     1827                if ((fvc->GetPvs().GetSize() < sMinPvs) ||       
     1828                        (bvc->GetPvs().GetSize() < sMinPvs) || 
     1829                        ((fdiff < sMinPvsDif) && (bvc->GetPvs().Diff(fvc->GetPvs()) < sMinPvsDif))) 
     1830                { 
     1831                        return true; 
     1832                } 
     1833        } 
     1834         
    18271835        return false; 
    18281836} 
  • trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.h

    r375 r378  
    793793        static bool sStoreSplitPolys; 
    794794 
    795         /// threshold where view cells are merged 
     795        //-- thresholds used for view cells are merging 
    796796        static int sMinPvsDif; 
     797        static int sMinPvs; 
     798        static int sMaxPvs; 
    797799 
    798800private: 
  • trunk/VUT/GtpVisibilityPreprocessor/src/X3dExporter.cpp

    r373 r378  
    267267    for (; vi != face->mVertexIndices.end(); vi++) 
    268268      stream<<*vi<<" "; 
     269        if (mWireframe) // final line to finish polygon 
     270                stream << (*face->mVertexIndices.begin()) << " "; 
     271 
    269272    stream<<"-1"<<endl; 
    270273  } 
Note: See TracChangeset for help on using the changeset viewer.