Ignore:
Timestamp:
05/15/08 16:00:23 (16 years ago)
Author:
mattausch
Message:

found error with qglpixelbuffer

File:
1 edited

Legend:

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

    r2678 r2679  
    10221022GlRendererBuffer::EvalPvsStat() 
    10231023{ 
    1024         MakeLive(); 
     1024        //MakeLive(); 
    10251025         
    10261026        GlRenderer::EvalPvsStat(); 
    10271027         
    1028         DoneLive(); 
     1028        //DoneLive(); 
    10291029        // mRenderingFinished.wakeAll(); 
    10301030} 
     
    10331033void GlRendererBuffer::EvalPvsStat(const SimpleRayContainer &viewPoints) 
    10341034{ 
    1035         MakeLive(); 
     1035        //MakeLive(); 
    10361036 
    10371037        GlRenderer::EvalPvsStat(viewPoints); 
    10381038   
    1039         DoneLive(); 
     1039        //DoneLive(); 
    10401040} 
    10411041 
     
    14761476GlRenderer::EvalPvsStat() 
    14771477{ 
    1478   mPvsStat.Reset(); 
    1479   halton.Reset(); 
    1480  
    1481   SetupProjection(GetWidth(), GetHeight()); 
    1482  
    1483   cout << "Random Pvs STATS, mPvsStatFrames=" << mPvsStatFrames << endl; 
    1484    
    1485   for (int i=0; i < mPvsStatFrames; i++) { 
    1486         float err; 
    1487         // set frame id for saving the error buffer 
    1488         mFrame = i; 
    1489  
    1490         //      cerr<<"RV"<<endl; 
    1491         RandomViewPoint(); 
    1492         //      cerr<<"RV2"<<endl; 
    1493  
    1494         if (mPvsErrorBuffer[i].mError == 1.0f) { 
    1495           // check if the view point is valid 
    1496           if (!ValidViewPoint()) { 
    1497                 mPvsErrorBuffer[i].mError = -1.0f; 
    1498           } 
    1499  
    1500           // manualy corrected view point 
    1501           if (mFrame == 5105) 
    1502                 mPvsErrorBuffer[i].mError = -1.0f; 
    1503         } 
    1504  
    1505  
    1506         if (mPvsErrorBuffer[i].mError > 0.0f) { 
    1507                 int pvsSize; 
    1508  
    1509                 float error = GetPixelError(pvsSize); 
    1510  
    1511                 mPvsErrorBuffer[i].mError = error; 
    1512                 mPvsErrorBuffer[i].mPvsSize = pvsSize; 
    1513  
    1514                 //cout<<"("<<i<<" ["<<mViewPoint<<"]["<<mViewDirection<<"] "<<mPvsErrorBuffer[i].mError<<")"; 
    1515         } 
    1516  
    1517         err = mPvsErrorBuffer[i].mError; 
    1518          
    1519         if (err >= 0.0f) { 
    1520           if (err > mPvsStat.maxError) 
    1521                 mPvsStat.maxError = err; 
    1522           mPvsStat.sumError += err; 
    1523           mPvsStat.sumPvsSize += mPvsErrorBuffer[i].mPvsSize; 
    1524            
    1525           if (err == 0.0f) 
    1526                 mPvsStat.errorFreeFrames++; 
    1527           mPvsStat.frames++; 
    1528         } 
    1529   } 
    1530    
    1531   glFinish(); 
    1532  
    1533   static bool first = true; 
    1534   if (first) { 
    1535          
    1536  
    1537         bool exportRandomViewCells; 
    1538         Environment::GetSingleton()->GetBoolValue("ViewCells.exportRandomViewCells", 
    1539                                                                                           exportRandomViewCells); 
    1540          
    1541         if (0 && exportRandomViewCells) 
    1542           { 
    1543                 char buff[512]; 
    1544                 Environment::GetSingleton()->GetStringValue("Scene.filename", buff); 
    1545                 string filename(buff); 
    1546  
    1547                 string viewCellPointsFile; 
    1548                  
    1549                 if (strstr(filename.c_str(), ".obj")) 
    1550                   viewCellPointsFile = ReplaceSuffix(filename, ".obj", ".vc"); 
    1551                 else if (strstr(filename.c_str(), ".dat")) 
    1552                   viewCellPointsFile = ReplaceSuffix(filename, ".dat", ".vc"); 
    1553                 else if (strstr(filename.c_str(), ".x3d")) 
    1554                   viewCellPointsFile = ReplaceSuffix(filename, ".x3d", ".vc"); 
    1555                  
    1556                  
    1557                 cout << "exporting random view cells" << endl; 
    1558                 preprocessor->mViewCellsManager->ExportRandomViewCells(viewCellPointsFile); 
    1559                 cout << "finished" << endl; 
    1560           } 
    1561         first = false; 
    1562   } 
    1563  
    1564   cout<<endl<<flush; 
     1478        mPvsStat.Reset(); 
     1479        halton.Reset(); 
     1480 
     1481        SetupProjection(GetWidth(), GetHeight()); 
     1482 
     1483        cout << "Random Pvs STATS, mPvsStatFrames=" << mPvsStatFrames << endl; 
     1484 
     1485        for (int i=0; i < mPvsStatFrames; i++) { 
     1486                float err; 
     1487                // set frame id for saving the error buffer 
     1488                mFrame = i; 
     1489 
     1490                //      cerr<<"RV"<<endl; 
     1491                RandomViewPoint(); 
     1492                //      cerr<<"RV2"<<endl; 
     1493 
     1494                if (mPvsErrorBuffer[i].mError == 1.0f) { 
     1495                        // check if the view point is valid 
     1496                        if (!ValidViewPoint()) { 
     1497                                mPvsErrorBuffer[i].mError = -1.0f; 
     1498                        } 
     1499 
     1500                        // manualy corrected view point 
     1501                        if (mFrame == 5105) 
     1502                                mPvsErrorBuffer[i].mError = -1.0f; 
     1503                } 
     1504 
     1505 
     1506                if (mPvsErrorBuffer[i].mError > 0.0f)  
     1507                { 
     1508                        int pvsSize; 
     1509 
     1510                        float error = GetPixelError(pvsSize); 
     1511 
     1512                        mPvsErrorBuffer[i].mError = error; 
     1513                        mPvsErrorBuffer[i].mPvsSize = pvsSize; 
     1514 
     1515                        //cout<<"("<<i<<" ["<<mViewPoint<<"]["<<mViewDirection<<"] "<<mPvsErrorBuffer[i].mError<<")"; 
     1516                } 
     1517 
     1518                err = mPvsErrorBuffer[i].mError; 
     1519 
     1520                if (err >= 0.0f) { 
     1521                        if (err > mPvsStat.maxError) 
     1522                                mPvsStat.maxError = err; 
     1523                        mPvsStat.sumError += err; 
     1524                        mPvsStat.sumPvsSize += mPvsErrorBuffer[i].mPvsSize; 
     1525 
     1526                        if (err == 0.0f) 
     1527                                mPvsStat.errorFreeFrames++; 
     1528                        mPvsStat.frames++; 
     1529                } 
     1530        } 
     1531 
     1532        glFinish(); 
     1533 
     1534        static bool first = true; 
     1535        if (first) { 
     1536 
     1537 
     1538                bool exportRandomViewCells; 
     1539                Environment::GetSingleton()->GetBoolValue("ViewCells.exportRandomViewCells", 
     1540                        exportRandomViewCells); 
     1541 
     1542                if (0 && exportRandomViewCells) 
     1543                { 
     1544                        char buff[512]; 
     1545                        Environment::GetSingleton()->GetStringValue("Scene.filename", buff); 
     1546                        string filename(buff); 
     1547 
     1548                        string viewCellPointsFile; 
     1549 
     1550                        if (strstr(filename.c_str(), ".obj")) 
     1551                                viewCellPointsFile = ReplaceSuffix(filename, ".obj", ".vc"); 
     1552                        else if (strstr(filename.c_str(), ".dat")) 
     1553                                viewCellPointsFile = ReplaceSuffix(filename, ".dat", ".vc"); 
     1554                        else if (strstr(filename.c_str(), ".x3d")) 
     1555                                viewCellPointsFile = ReplaceSuffix(filename, ".x3d", ".vc"); 
     1556 
     1557 
     1558                        cout << "exporting random view cells" << endl; 
     1559                        preprocessor->mViewCellsManager->ExportRandomViewCells(viewCellPointsFile); 
     1560                        cout << "finished" << endl; 
     1561                } 
     1562                first = false; 
     1563        } 
     1564 
     1565        cout<<endl<<flush; 
    15651566} 
    15661567 
     
    15801581        for (sit = viewPoints.begin(); sit != sit_end; ++ sit, ++ i)  
    15811582        { 
    1582                 if ((i % 10) == 99) 
     1583                if ((i % 100) == 99) 
    15831584                        cout << "processed " << i << " view points " << endl; 
    15841585 
     
    16031604 
    16041605                        const int pixelError = (int)mPvsErrorBuffer[i].mError * GetWidth() * GetHeight(); 
     1606 
    16051607                        if (0 && (pixelError > 0) && (pvsSize > 0))  
    16061608                        { 
     
    16231625                                mPvsStat.maxError = err; 
    16241626 
    1625                                 cout << "new max error: " << mPvsStat.maxError * GetWidth()*GetHeight()  << endl; 
     1627                                cout << "new max error: " << mPvsStat.maxError * GetWidth() * GetHeight()  << endl; 
    16261628                        } 
    16271629 
Note: See TracChangeset for help on using the changeset viewer.