Changeset 2050


Ignore:
Timestamp:
01/24/07 06:53:09 (17 years ago)
Author:
bittner
Message:

render error

Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
6 edited

Legend:

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

    r2049 r2050  
    117117{ 
    118118  Triangle3 &t = object->GetItem(); 
    119    
     119 
    120120  glBegin(GL_TRIANGLES); 
    121121  Vector3 normal = t.GetNormal(); 
     
    130130GlRenderer::RenderIntersectable(Intersectable *object) 
    131131{ 
     132  if (!object) 
     133        return; 
     134   
    132135  if (object->Mailed()) 
    133136        return; 
     137 
    134138  object->Mail(); 
    135139   
     
    13891393void GlRenderer::EvalPvsStat(const SimpleRayContainer &viewPoints) 
    13901394{ 
    1391         ClearErrorBuffer(); 
    1392  
    1393         mPvsStat.Reset(); 
    1394         halton.Reset(); 
    1395  
    1396         SetupProjection(GetWidth(), GetHeight()); 
    1397  
    1398         cout << "mPvsStatFrames=" << mPvsStatFrames << endl; 
    1399  
    1400         SimpleRayContainer::const_iterator sit, sit_end = viewPoints.end(); 
    1401         int i = 0; 
    1402  
    1403         for (sit = viewPoints.begin(); sit != sit_end; ++ sit, ++ i)  
    1404         { 
    1405                 //cout << "view point: " << (*sit) << endl;; 
    1406                 SimpleRay sray = *sit; 
    1407  
    1408                 float err; 
    1409  
    1410                 // set frame id for saving the error buffer 
    1411                 mFrame = i; 
    1412                 mViewPoint = sray.mOrigin; 
    1413                 mViewDirection = sray.mDirection; 
    1414  
    1415                 if (0 && (mPvsErrorBuffer[i].mError == 1.0f)) 
     1395  mPvsStat.Reset(); 
     1396 
     1397  SetupProjection(GetWidth(), GetHeight()); 
     1398   
     1399  cout << "mPvsStatFrames=" << mPvsStatFrames << endl; 
     1400   
     1401  SimpleRayContainer::const_iterator sit, sit_end = viewPoints.end(); 
     1402  int i = 0; 
     1403   
     1404  for (sit = viewPoints.begin(); sit != sit_end; ++ sit, ++ i)  
     1405        { 
     1406           
     1407          //cout << "view point: " << (*sit) << endl;; 
     1408          SimpleRay sray = *sit; 
     1409           
     1410          float err; 
     1411           
     1412          // set frame id for saving the error buffer 
     1413          mFrame = i; 
     1414          mViewPoint = sray.mOrigin; 
     1415          mViewDirection = sray.mDirection; 
     1416           
     1417          if (mPvsErrorBuffer[i].mError > 0.0f)  
    14161418                { 
    1417                         // check if the view point is valid 
    1418                         if (!ValidViewPoint()) 
    1419                         { 
    1420                                 cout << "error: " << " view point invalid" << endl; 
    1421                                 mPvsErrorBuffer[i].mError = -1.0f; 
    1422                         } 
    1423                         else 
    1424                         { 
    1425                                 cout << "view point valid" << endl; 
    1426                         } 
     1419                  int pvsSize; 
     1420                   
     1421                  // compute the pixel error 
     1422                  float error = GetPixelError(pvsSize); 
     1423                   
     1424                  mPvsErrorBuffer[i].mError = error; 
     1425                  mPvsErrorBuffer[i].mPvsSize = pvsSize; 
     1426                   
     1427                  cout << "(" << i << "," << mPvsErrorBuffer[i].mError <<")"; 
    14271428                } 
    1428  
    1429                 if (mPvsErrorBuffer[i].mError > 0.0f)  
     1429           
     1430          err = mPvsErrorBuffer[i].mError; 
     1431           
     1432          if (err >= 0.0f)  
    14301433                { 
    1431                         int pvsSize; 
    1432  
    1433                         // compute the pixel error 
    1434                         float error = GetPixelError(pvsSize); 
    1435  
    1436                         mPvsErrorBuffer[i].mError = error; 
    1437                         mPvsErrorBuffer[i].mPvsSize = pvsSize; 
    1438  
    1439                         cout << "(" << i << "," << mPvsErrorBuffer[i].mError <<")"; 
    1440                 } 
    1441  
    1442                 err = mPvsErrorBuffer[i].mError; 
    1443  
    1444                 if (err >= 0.0f)  
    1445                 { 
    1446                         if (err > mPvsStat.maxError) 
    1447                                 mPvsStat.maxError = err; 
    1448  
    1449                         mPvsStat.sumError += err; 
     1434                  if (err > mPvsStat.maxError) 
     1435                        mPvsStat.maxError = err; 
     1436                   
     1437                  mPvsStat.sumError += err; 
    14501438                        mPvsStat.sumPvsSize += mPvsErrorBuffer[i].mPvsSize; 
    1451  
     1439                         
    14521440                        if (err == 0.0f) 
    1453                                 ++ mPvsStat.errorFreeFrames; 
    1454  
     1441                          ++ mPvsStat.errorFreeFrames; 
     1442                         
    14551443                        ++ mPvsStat.frames; 
    14561444                } 
    14571445        } 
    1458  
    1459         glFinish(); 
    1460         cout << endl << flush; 
     1446   
     1447  glFinish(); 
     1448  cout << endl << flush; 
    14611449} 
    14621450 
  • GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.h

    r2048 r2050  
    199199friend class ViewCellsManager; 
    200200 
     201  vector<PvsErrorEntry> mPvsErrorBuffer; 
     202 
    201203protected: 
    202204 
    203205   
    204   vector<PvsErrorEntry> mPvsErrorBuffer; 
    205206 
    206207  PvsCache mPvsCache; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Mutation.cpp

    r2048 r2050  
    2020#define USE_SILHOUETTE_MUTATIONS 0 
    2121 
    22 #define SIL_TERMINATION_MUTATION_PROB 0.9f 
     22 
     23#define SIL_TERMINATION_MUTATION_PROB 0.8f 
    2324 
    2425#define EVALUATE_MUTATION_STATS 1 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp

    r2049 r2050  
    14611461          vector<ViewCellPoints *> *vcPoints = mViewCellsManager->GetViewCellPoints(); 
    14621462           
    1463           vector<ViewCellPoints *>::const_iterator vit, vit_end = vcPoints->end(); 
     1463          vector<ViewCellPoints *>::const_iterator 
     1464                vit = vcPoints->begin(), 
     1465                vit_end = vcPoints->end(); 
     1466 
    14641467          SimpleRayContainer viewPoints; 
    14651468           
    1466           for (vit = vcPoints->begin(); vit != vit_end; ++ vit) { 
     1469          for (; vit != vit_end; ++ vit) { 
    14671470                ViewCellPoints *vp = *vit; 
    14681471 
     
    14711474                  viewPoints.push_back(*rit); 
    14721475          } 
    1473            
     1476 
     1477          if (viewPoints.size() != renderer->mPvsErrorBuffer.size()) { 
     1478                renderer->mPvsErrorBuffer.resize(viewPoints.size()); 
     1479                renderer->ClearErrorBuffer(); 
     1480          } 
     1481 
    14741482          renderer->EvalPvsStat(viewPoints); 
    14751483        } else 
    14761484          renderer->EvalPvsStat(); 
    1477          
     1485 
    14781486        mStats << 
    14791487          "#AvgPvsRenderError\n" <<renderer->mPvsStat.GetAvgError()<<endl<< 
  • GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp

    r2049 r2050  
    8989  float pErrorPixels = -1.0f; 
    9090   
    91   glReadBuffer(GL_BACK); 
    92    
    93   //  mUseFalseColors = true; 
    9491   
    9592  mUseFalseColors = false; 
    9693  unsigned int pixelCount; 
    97  
     94   
    9895   
    9996  ViewCell *viewcell = mViewCellsManager->GetViewCell(mViewPoint); 
    100    
     97  //  cout<<"View cell"<<viewcell<<endl; 
    10198  if (viewcell == NULL) 
    10299        return 0.0f; 
     
    119116                                                                        pvs); 
    120117  } 
    121    
     118 
     119  //  cout<<"pvs size"<<pvs.GetSize()<<endl<<flush; 
     120 
    122121  SetupCamera(); 
    123122  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); 
     
    138137        RenderIntersectable(object); 
    139138  } 
    140    
     139 
     140 
    141141  //    glColorMask(GL_TRUE, GL_FALSE, GL_FALSE, GL_FALSE); 
    142142  glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 
     
    162162  //  } 
    163163 
     164 
    164165  pixelCount = query->GetQueryResult(); 
    165166   
     
    167168   
    168169   
    169   if (0 && mSnapErrorFrames && pErrorPixels >= 0.01f) { 
    170          
     170  if (mSnapErrorFrames && pErrorPixels >= 0.01f) { 
     171        glReadBuffer(GL_BACK); 
     172 
    171173        char filename[256]; 
    172174        sprintf(filename, "error-frame-%04d-%0.5f.png", mFrame, pErrorPixels); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/default.env

    r2049 r2050  
    6161#       type render 
    6262        detectEmptyViewSpace true 
    63         pvsRenderErrorSamples 0 
     63        pvsRenderErrorSamples 20 
    6464#       pvsRenderErrorSamples 10000 
    6565        quitOnFinish false 
Note: See TracChangeset for help on using the changeset viewer.