Changeset 2002


Ignore:
Timestamp:
01/21/07 00:14:50 (17 years ago)
Author:
bittner
Message:

renderer code updates for pixel error measurements

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

Legend:

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

    r1984 r2002  
    5555                                                                                          buff); 
    5656   
    57  
     57   
    5858  mMixtureDistribution = new MixtureDistribution(*this); 
    5959  mMixtureDistribution->Construct(buff); 
     
    6666  mPass = 0; 
    6767   
     68 
     69   
     70  bool mExportAnimation = false; 
     71  vector<VssRayContainer> rayBuffer; 
     72   
     73 
    6874  long startTime = GetTime(); 
    6975  for (int i=0; i < mTotalSamples; i += mSamplesPerPass, mPass++) { 
     
    9399          ExportRays(filename, vssRays, mExportNumRays); 
    94100 
     101 
     102          if (mExportAnimation) { 
     103                rayBuffer.push_back(VssRayContainer()); 
     104                vssRays.SelectRays(mExportNumRays, rayBuffer[rayBuffer.size()-1], true); 
     105          } 
     106 
    95107          Debug<<"done."<<endl<<flush; 
    96108        } 
     
    106118                "#RssSamples\n" <<totalVssRays<<endl; 
    107119          lastEvaluation = i; 
     120 
     121          if (renderer) { 
     122                ComputeRenderError(); 
     123          } 
     124           
    108125        } 
    109126 
     
    120137        //        CLEAR_CONTAINER(vssRays); 
    121138 
    122         if (renderer) { 
    123           ComputeRenderError(); 
    124         } 
    125139         
    126140  } 
     141   
     142  EvalViewCellHistogram(); 
    127143 
    128   EvalViewCellHistogram(); 
     144  if (mExportAnimation && mExportRays) { 
     145        char filename[64]; 
     146        sprintf(filename, "rss-rays-i.x3d"); 
     147        //rayBuffer.resize(mPass); 
     148        ExportRayAnimation(filename, rayBuffer); 
     149  } 
    129150 
    130151  return true; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp

    r1997 r2002  
    8989  mUseForcedColors = false; 
    9090  mRenderBoxes = false; 
    91   //mUseGlLists = true; 
    92   mUseGlLists = false; 
     91  mUseGlLists = true; 
     92  //mUseGlLists = false; 
    9393 
    9494  Environment::GetSingleton()->GetIntValue("Preprocessor.pvsRenderErrorSamples", mPvsStatFrames); 
     
    328328   
    329329  glClearColor(0.0f, 0.0f, 1.0f, 1.0f); 
     330   
     331  OcclusionQuery::GenQueries(mOcclusionQueries, 10); 
    330332} 
    331333 
     
    363365{ 
    364366  ObjectContainer::const_iterator oi = mObjects.begin(); 
    365  
    366367  for (; oi != mObjects.end(); oi++) 
    367368        RenderIntersectable(*oi); 
     369} 
     370 
     371void 
     372GlRenderer::_RenderSceneTriangles() 
     373{ 
     374  glBegin(GL_TRIANGLES); 
     375 
     376  ObjectContainer::const_iterator oi = mObjects.begin(); 
     377  for (; oi != mObjects.end(); oi++) { 
     378         
     379        if ((*oi)->Type() == Intersectable::TRIANGLE_INTERSECTABLE) { 
     380          TriangleIntersectable *object = (TriangleIntersectable *)*oi; 
     381          Triangle3 &t = object->GetItem(); 
     382           
     383          Vector3 normal = t.GetNormal(); 
     384          glNormal3f(normal.x, normal.y, normal.z); 
     385          glVertex3f(t.mVertices[0].x, t.mVertices[0].y, t.mVertices[0].z); 
     386          glVertex3f(t.mVertices[1].x, t.mVertices[1].y, t.mVertices[1].z); 
     387          glVertex3f(t.mVertices[2].x, t.mVertices[2].y, t.mVertices[2].z); 
     388           
     389        } 
     390  } 
     391 
     392  glEnd(); 
     393   
    368394} 
    369395 
     
    377403          glList = glGenLists(1); 
    378404          glNewList(glList, GL_COMPILE); 
    379           _RenderScene(); 
     405          _RenderSceneTriangles(); 
    380406          glEndList(); 
    381407        } 
     
    383409        glCallList(glList); 
    384410  } else 
    385         _RenderScene(); 
     411        _RenderSceneTriangles(); 
    386412         
    387413   
     
    826852        mPvsErrorBuffer[i].mError = 1.0f; 
    827853  } 
     854  mPvsStat.maxError = 0.0f; 
    828855} 
    829856 
     
    12701297  halton.Reset(); 
    12711298 
    1272  
    12731299  SetupProjection(GetWidth(), GetHeight()); 
    12741300 
     
    12811307        RandomViewPoint(); 
    12821308 
     1309        if (mPvsErrorBuffer[i].mError == 1.0f) { 
     1310          // check if the view point is valid 
     1311          if (!ValidViewPoint()) 
     1312                mPvsErrorBuffer[i].mError = -1.0f; 
     1313 
     1314          // manualy corrected view point 
     1315          if (mFrame == 5105) 
     1316                mPvsErrorBuffer[i].mError = -1.0f; 
     1317        } 
     1318         
     1319         
    12831320        // atlanta problematic frames: 325 525 691 1543 
    12841321#if 0 
     
    12931330#endif 
    12941331         
    1295         if (mPvsErrorBuffer[i].mError > 0.0f) { 
     1332        if (mPvsErrorBuffer[i].mError > 0.0f) { 
    12961333          int pvsSize; 
    1297  
    1298  
     1334           
    12991335          float error = GetPixelError(pvsSize); 
    13001336          mPvsErrorBuffer[i].mError = error; 
     
    13031339          //      emit UpdatePvsErrorItem(i, 
    13041340          //                                                      mPvsErrorBuffer[i]); 
    1305  
    13061341          cout<<"("<<i<<","<<mPvsErrorBuffer[i].mError<<")"; 
    13071342          //      swapBuffers(); 
     
    13211356        } 
    13221357  } 
    1323  
     1358   
    13241359  glFinish(); 
    13251360  cout<<endl<<flush; 
    1326  
    1327 } 
    1328  
     1361} 
     1362 
     1363bool 
     1364GlRenderer::ValidViewPoint() 
     1365{ 
     1366  if (!mDetectEmptyViewSpace) 
     1367        return true; 
     1368 
     1369  OcclusionQuery *query = mOcclusionQueries[0]; 
     1370 
     1371  // now check whether any backfacing polygon would pass the depth test 
     1372  SetupCamera(); 
     1373  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 
     1374  glEnable( GL_CULL_FACE ); 
     1375  glCullFace(GL_BACK); 
     1376   
     1377  //  cout<<"VV1 "; 
     1378  RenderScene(); 
     1379   
     1380  glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); 
     1381  glDepthMask(GL_FALSE); 
     1382  glDisable( GL_CULL_FACE ); 
     1383   
     1384  query->BeginQuery(); 
     1385   
     1386  //  cout<<"VV2 "; 
     1387  RenderScene(); 
     1388  //  cout<<"VV3 "; 
     1389   
     1390  query->EndQuery(); 
     1391   
     1392  // at this point, if possible, go and do some other computation 
     1393  glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 
     1394  glDepthMask(GL_TRUE); 
     1395  glEnable( GL_CULL_FACE ); 
     1396 
     1397  //  int wait = 0; 
     1398  //  while (!query.ResultAvailable()) { 
     1399  //    wait++; 
     1400  //  } 
     1401   
     1402  // reenable other state 
     1403  unsigned int pixelCount = query->GetQueryResult(); 
     1404  //  cout<<"VV4 "; 
     1405   
     1406  if (pixelCount > 0) 
     1407        return false; // backfacing polygon found -> not a valid viewspace sample 
     1408 
     1409  return true; 
     1410} 
    13291411 
    13301412float 
    13311413GlRenderer::GetPixelError(int &pvsSize) 
    13321414{ 
    1333   float pErrorPixels = -1.0f; 
    1334    
    1335   glReadBuffer(GL_BACK); 
    1336    
    1337   //  mUseFalseColors = true; 
    1338    
    1339   mUseFalseColors = false; 
    1340   unsigned int pixelCount; 
    1341  
    1342   //static int query = -1; 
    1343   //if (query == -1) 
    1344   //      glGenOcclusionQueriesNV(1, (unsigned int *)&query); 
    1345  
    1346   OcclusionQuery query; 
    1347  
    1348   ViewCell *viewcell = mViewCellsManager->GetViewCell(mViewPoint); 
    1349   if (viewcell == NULL) 
    1350         return 0.0f; 
    1351  
    1352   if (mDetectEmptyViewSpace) { 
    1353         // now check whether any backfacing polygon would pass the depth test 
    1354         SetupCamera(); 
    1355         glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 
    1356         glEnable( GL_CULL_FACE ); 
    1357         glCullFace(GL_BACK); 
    1358  
    1359         cout<<"RS "; 
    1360         RenderScene(); 
    1361          
    1362         glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); 
    1363         glDepthMask(GL_FALSE); 
    1364         glDisable( GL_CULL_FACE ); 
    1365  
    1366         query.BeginQuery(); 
    1367          
    1368         cout<<"RS "; 
    1369         RenderScene(); 
    1370         cout<<"RS3 "; 
    1371          
    1372         query.EndQuery(); 
    1373          
    1374         // at this point, if possible, go and do some other computation 
    1375         glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 
    1376         glDepthMask(GL_TRUE); 
    1377         glEnable( GL_CULL_FACE ); 
    1378          
    1379         // reenable other state 
    1380         pixelCount = query.GetQueryResult(); 
    1381         cout<<"RS4 "; 
    1382          
    1383         if (pixelCount > 0) 
    1384           return -1.0f; // backfacing polygon found -> not a valid viewspace sample 
    1385  
    1386   } else 
    1387         glDisable( GL_CULL_FACE ); 
    1388          
    1389  
    1390   //  ViewCell *viewcell = NULL; 
    1391    
    1392   //  PrVs prvs; 
    1393    
    1394   //  mViewCellsManager->SetMaxFilterSize(0); 
    1395   //  mViewCellsManager->GetPrVS(mViewPoint, prvs, mViewCellsManager->GetFilterWidth()); 
    1396   //  viewcell = prvs.mViewCell; 
    1397    
    1398   ObjectPvs pvs; 
    1399   if (1) { 
    1400         pvs = viewcell->GetPvs(); 
    1401   } else { 
    1402         mViewCellsManager->ApplyFilter2(viewcell, 
    1403                                                                         false, 
    1404                                                                         1.0f, 
    1405                                                                         pvs); 
    1406   } 
    1407    
    1408   SetupCamera(); 
    1409   glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 
    1410   glColorMask(GL_FALSE, GL_TRUE, GL_FALSE, GL_FALSE); 
    1411    
    1412    
    1413   //    // Render PVS 
    1414   ObjectPvsIterator it = pvs.GetIterator(); 
    1415    
    1416   pvsSize = pvs.GetSize(); 
    1417   Intersectable::NewMail(); 
    1418   for (; it.HasMoreEntries(); ) { 
    1419         ObjectPvsEntry entry = it.Next(); 
    1420         Intersectable *object = entry.mObject; 
    1421         RenderIntersectable(object); 
    1422   } 
    1423    
    1424   //    glColorMask(GL_TRUE, GL_FALSE, GL_FALSE, GL_FALSE); 
    1425   glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 
    1426    
    1427   mUseFalseColors = true; 
    1428    
    1429   query.BeginQuery(); 
    1430    
    1431   SetupCamera(); 
    1432    
    1433   RenderScene(); 
    1434    
    1435   query.EndQuery(); 
    1436    
    1437    
    1438   // reenable other state 
    1439   pixelCount = query.GetQueryResult(); 
    1440    
    1441    
    1442   pErrorPixels = ((float)pixelCount)/(GetWidth()*GetHeight()); 
    1443  
    1444 #if 0   
    1445   if (mSnapErrorFrames && pErrorPixels > 0.001f) { 
    1446          
    1447         char filename[256]; 
    1448         sprintf(filename, "error-frame-%04d-%0.5f.png", mFrame, pErrorPixels); 
    1449         QImage im = toImage(); 
    1450         string str = mSnapPrefix + filename; 
    1451         QString qstr(str.c_str()); 
    1452          
    1453         im.save(qstr, "PNG"); 
    1454         if (1) { //0 && mFrame == 1543) { 
    1455           int x,y; 
    1456           int lastIndex = -1; 
    1457           for (y=0; y < im.height(); y++) 
    1458                 for (x=0; x < im.width(); x++) { 
    1459                   QRgb p = im.pixel(x,y); 
    1460                   int index = qRed(p) + (qGreen(p)<<8) + (qBlue(p)<<16); 
    1461                   if (qGreen(p) != 255 && index!=0) { 
    1462                         if (index != lastIndex) { 
    1463                           //                            Debug<<"ei="<<index<<" "; 
    1464                           lastIndex = index; 
    1465                         } 
    1466                   } 
    1467                 } 
    1468         } 
    1469          
    1470          
    1471         mUseFalseColors = false; 
    1472         glPushAttrib(GL_CURRENT_BIT); 
    1473         glColor3f(0,1,0); 
    1474         glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 
    1475         SetupCamera(); 
    1476         glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 
    1477          
    1478         // Render PVS 
    1479         Intersectable::NewMail(); 
    1480  
    1481         ObjectPvsIterator it = pvs.GetIterator(); 
    1482         for (; it.HasMoreEntries(); ) { 
    1483           ObjectPvsEntry entry = it.Next(); 
    1484           Intersectable *object = entry.mObject; 
    1485           RenderIntersectable(object); 
    1486         } 
    1487          
    1488         im = toImage(); 
    1489         sprintf(filename, "error-frame-%04d-%0.5f-pvs.png", mFrame, pErrorPixels); 
    1490         str = mSnapPrefix + filename; 
    1491         qstr = str.c_str(); 
    1492         im.save(qstr, "PNG"); 
    1493         glPopAttrib(); 
    1494   } 
    1495 #endif 
    1496    
    1497   glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 
    1498    
    1499   return pErrorPixels; 
     1415  return -1.0f; 
    15001416} 
    15011417 
  • GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.h

    r1997 r2002  
    137137 
    138138  void 
     139  _RenderSceneTriangles(); 
     140 
     141  void 
    139142  RenderViewPoint(); 
    140143 
     
    142145  SetupProjection(const int w, const int h, const float angle = 70.0f); 
    143146 
     147  virtual bool 
     148  ValidViewPoint(); 
    144149   
    145150  virtual float 
     
    166171  virtual void ClearErrorBuffer(); 
    167172   
    168  
     173  virtual float GetAvgPixelError() { 
     174        return mPvsStat.GetAvgError()*GetWidth()*GetHeight(); 
     175  } 
     176   
    169177public: 
    170178 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Makefile

    r2001 r2002  
    11############################################################################# 
    22# Makefile for building: preprocessor 
    3 # Generated by qmake (2.00a) (Qt 4.1.2) on: pá 19. I 15:33:39 2007 
     3# Generated by qmake (2.00a) (Qt 4.1.2) on: so 20. I 14:03:52 2007 
    44# Project:  preprocessor.pro 
    55# Template: app 
     
    6363        $(MAKE) -f $(MAKEFILE).Debug uninstall 
    6464 
    65 Makefile: preprocessor.pro  C:/Qt/4.1.2/mkspecs/win32-msvc2005\qmake.conf C:/Qt/4.1.2/mkspecs/qconfig.pri \ 
     65Makefile: preprocessor.pro  C:/Qt/4.1.2/mkspecs/win32-msvc.net\qmake.conf C:/Qt/4.1.2/mkspecs/qconfig.pri \ 
    6666                C:\Qt\4.1.2\mkspecs\features\qt_config.prf \ 
    6767                C:\Qt\4.1.2\mkspecs\features\exclusive_builds.prf \ 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Mutation.cpp

    r2001 r2002  
    158158 
    159159  float pContributingRays = contributingRays/(float)vssRays.size(); 
    160   float importance = 1.0f/(pContributingRays + 1e-5); 
     160  //  float importance = 1.0f/(pContributingRays + 1e-5); 
     161  float importance = 1.0f; 
    161162  // set this values for last contributingRays 
    162163  int index = mBufferStart - 1; 
     
    566567        mRays[index].ResetReverseMutation(); 
    567568        mRays[index].mMutations++; 
     569        mRays[index].mUnsuccessfulMutations++; 
     570 
    568571        return true; 
    569572  } 
     
    616619  // optimal for Vienna 0.5f 
    617620   
    618   float radiusExtension = 0.5f; 
     621  float radiusExtension = 0.1f; 
    619622  //  + mRays[index].mMutations/50.0f; 
    620623   
     
    672675  if (GenerateMutationCandidate(index, sray, object, box)) { 
    673676    mRays[index].mMutations++; 
     677        mRays[index].mUnsuccessfulMutations++; 
     678 
    674679        return true; 
    675680  } 
     
    738743  sray = mutationCandidates[id]; 
    739744  mRays[index].mMutations++; 
     745  mRays[index].mUnsuccessfulMutations++; 
    740746 
    741747  return true; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/OcclusionQuery.cpp

    r1785 r2002  
    88namespace GtpVisibilityPreprocessor { 
    99 
    10 bool OcclusionQuery::sUseArbQueries = false; 
     10bool OcclusionQuery::sUseArbQueries = true; 
    1111 
    1212 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp

    r2001 r2002  
    11501150  if (1) { 
    11511151        VssRayContainer tmpRays; 
    1152         for (int i=0; i < 200; i++) { 
     1152        int m = 50000; 
     1153        for (int i=m; i < m+20; i++) { 
    11531154          tmpRays.push_back(new VssRay(rays[i].mOrigin, 
    11541155                                                                   rays[i].mOrigin + 100.0f*rays[i].mDirection, 
     
    13301331} 
    13311332 
     1333bool 
     1334Preprocessor::ExportRayAnimation(const char *filename, 
     1335                                                                 const vector<VssRayContainer> &vssRays 
     1336                                                                 ) 
     1337{ 
     1338  cout<<"Exporting vss rays..."<<endl<<flush; 
     1339         
     1340  Exporter *exporter = NULL; 
     1341  exporter = Exporter::GetExporter(filename); 
     1342  if (0) { 
     1343        exporter->SetWireframe(); 
     1344        exporter->ExportKdTree(*mKdTree); 
     1345  } 
     1346  exporter->SetFilled(); 
     1347  // $$JB temporarily do not export the scene 
     1348  if (1) 
     1349        exporter->ExportScene(mSceneGraph->GetRoot()); 
     1350  exporter->SetWireframe(); 
     1351 
     1352  if (1) { 
     1353        exporter->SetForcedMaterial(RgbColor(1,0,1)); 
     1354        exporter->ExportBox(mViewCellsManager->GetViewSpaceBox()); 
     1355        exporter->ResetForcedMaterial(); 
     1356  } 
     1357   
     1358  exporter->ExportRaySets(vssRays, RgbColor(1, 0, 0)); 
     1359         
     1360  delete exporter; 
     1361 
     1362  cout<<"done."<<endl<<flush; 
     1363 
     1364  return true; 
     1365} 
     1366 
    13321367void 
    13331368Preprocessor::ComputeRenderError() 
     
    13461381        mStats << 
    13471382          "#AvgPvsRenderError\n" <<renderer->mPvsStat.GetAvgError()<<endl<< 
     1383          "#AvgPixelError\n" <<renderer->GetAvgPixelError()<<endl<< 
    13481384          "#MaxPvsRenderError\n" <<renderer->mPvsStat.GetMaxError()<<endl<< 
    13491385          "#ErrorFreeFrames\n" <<renderer->mPvsStat.GetErrorFreeFrames()<<endl<< 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h

    r2001 r2002  
    129129                           ); 
    130130 
     131  bool 
     132  ExportRayAnimation(const char *filename, 
     133                                         const vector<VssRayContainer> &vssRays 
     134                                         ); 
     135 
    131136        virtual int 
    132137                GenerateRays(const int number, 
  • GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp

    r1997 r2002  
    8383 
    8484 
    85  
     85// reimplemented here so that we can snap the error windows 
    8686float 
    8787QtGlRendererBuffer::GetPixelError(int &pvsSize) 
     
    9696  unsigned int pixelCount; 
    9797 
    98   //static int query = -1; 
    99   //if (query == -1) 
    100   //      glGenOcclusionQueriesNV(1, (unsigned int *)&query); 
    101  
    102   OcclusionQuery query; 
    10398 
    10499  ViewCell *viewcell = mViewCellsManager->GetViewCell(mViewPoint); 
    105100  if (viewcell == NULL) 
    106101        return 0.0f; 
    107  
    108   if (mDetectEmptyViewSpace) { 
    109         // now check whether any backfacing polygon would pass the depth test 
    110         SetupCamera(); 
    111         glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 
    112         glEnable( GL_CULL_FACE ); 
    113         glCullFace(GL_BACK); 
    114  
    115         cout<<"RS "; 
    116         RenderScene(); 
    117          
    118         glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); 
    119         glDepthMask(GL_FALSE); 
    120         glDisable( GL_CULL_FACE ); 
    121  
    122         query.BeginQuery(); 
    123          
    124         cout<<"RS "; 
    125         RenderScene(); 
    126         cout<<"RS3 "; 
    127          
    128         query.EndQuery(); 
    129          
    130         // at this point, if possible, go and do some other computation 
    131         glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 
    132         glDepthMask(GL_TRUE); 
    133         glEnable( GL_CULL_FACE ); 
    134          
    135         // reenable other state 
    136         pixelCount = query.GetQueryResult(); 
    137         cout<<"RS4 "; 
    138          
    139         if (pixelCount > 0) 
    140           return -1.0f; // backfacing polygon found -> not a valid viewspace sample 
    141  
    142   } else 
    143         glDisable( GL_CULL_FACE ); 
    144          
    145  
     102   
    146103  //  ViewCell *viewcell = NULL; 
    147104   
     
    182139   
    183140  mUseFalseColors = true; 
    184    
    185   query.BeginQuery(); 
     141 
     142  OcclusionQuery *query = mOcclusionQueries[0]; 
     143 
     144  query->BeginQuery(); 
    186145   
    187146  SetupCamera(); 
     
    189148  RenderScene(); 
    190149   
    191   query.EndQuery(); 
    192    
     150  query->EndQuery(); 
    193151   
    194152  // reenable other state 
    195   pixelCount = query.GetQueryResult(); 
    196    
     153  //  int wait=0; 
     154  //  while (!query.ResultAvailable()) { 
     155  //    wait++; 
     156  //  } 
     157 
     158  pixelCount = query->GetQueryResult(); 
    197159   
    198160  pErrorPixels = ((float)pixelCount)/(GetWidth()*GetHeight()); 
    199  
    200    
    201   if (mSnapErrorFrames && pErrorPixels > 0.001f) { 
     161   
     162   
     163  if (mSnapErrorFrames && pErrorPixels > 0.01f) { 
    202164         
    203165        char filename[256]; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/RayCaster.cpp

    r1996 r2002  
    163163  int i; 
    164164 
    165   if (depth%5==0) 
    166         offset = 3; 
    167    
    168   for (i=offset; i < offset+3; i++) { 
    169         float diff = box[i+6] - box[i]; 
     165  // if (depth%4==0) 
     166  //    offset = 3; 
     167   
     168  for (i=offset; i < offset + 3; i++) { 
     169        float diff = box[i + 6] - box[i]; 
    170170        if (diff > maxDiff) { 
    171171          maxDiff = diff; 
     
    184184        while(rays[i].GetParam(axis) < x && i<=j) 
    185185          i++; 
    186         while(x < rays[j].GetParam(axis) && i<=j) 
     186        while(x <= rays[j].GetParam(axis) && i<=j) 
    187187          j--; 
    188188         
     
    194194  } while (i<=j); 
    195195   
    196   if (l + 64 < j ) { 
     196  if (l + 4 < j ) { 
    197197        // set new max 
    198198        float save = box[axis+6]; 
     
    202202  } 
    203203   
    204   if (i + 64 < r) { 
     204  if (i + 4 < r) { 
    205205        // set new min 
    206206        box[axis] = x; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.cpp

    r1966 r2002  
    165165 
    166166 
    167 bool 
    168 RssPreprocessor::ExportRayAnimation(const char *filename, 
    169                                                                         const vector<VssRayContainer> &vssRays 
    170                                                                         ) 
    171 { 
    172   cout<<"Exporting vss rays..."<<endl<<flush; 
    173          
    174   Exporter *exporter = NULL; 
    175   exporter = Exporter::GetExporter(filename); 
    176   if (0) { 
    177         exporter->SetWireframe(); 
    178         exporter->ExportKdTree(*mKdTree); 
    179   } 
    180   exporter->SetFilled(); 
    181   // $$JB temporarily do not export the scene 
    182   if (1) 
    183         exporter->ExportScene(mSceneGraph->GetRoot()); 
    184   exporter->SetWireframe(); 
    185  
    186   if (1) { 
    187         exporter->SetForcedMaterial(RgbColor(1,0,1)); 
    188         exporter->ExportBox(mViewCellsManager->GetViewSpaceBox()); 
    189         exporter->ResetForcedMaterial(); 
    190   } 
    191    
    192   exporter->ExportRaySets(vssRays, RgbColor(1, 0, 0)); 
    193          
    194   delete exporter; 
    195  
    196   cout<<"done."<<endl<<flush; 
    197  
    198   return true; 
    199 } 
    200167 
    201168 
  • GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.h

    r1931 r2002  
    7171 
    7272 
    73   bool 
    74   ExportRayAnimation(const char *filename, 
    75                                          const vector<VssRayContainer> &vssRays 
    76                                          ); 
    7773 
    7874  void 
  • GTP/trunk/Lib/Vis/Preprocessing/src/default.env

    r1989 r2002  
    3939Preprocessor { 
    4040        totalSamples 250000000 
     41#       totalSamples 2000000 
    4142        samplesPerPass 1000000 
     43        samplesPerEvaluation 5000000 
     44 
     45 
    4246#       initialSamples 2000000 
    43         samplesPerEvaluation 5000000 
    44  
     47 
     48        exportObj false 
    4549        delayVisibilityComputation false 
    4650        # stored sample rays 
     
    5761#       type render 
    5862        detectEmptyViewSpace true 
    59         pvsRenderErrorSamples 0 
    60 #       pvsRenderErrorSamples 1000 
     63#       pvsRenderErrorSamples 0 
     64        pvsRenderErrorSamples 5000 
    6165        quitOnFinish false 
    6266        computeVisibility true 
  • GTP/trunk/Lib/Vis/Preprocessing/src/run_test2

    r2001 r2002  
    22 
    33#COMMAND="./release/preprocessor.exe -preprocessor_quit_on_finish+" 
    4 COMMAND="../scripts/preprocessor.sh -preprocessor_quit_on_finish+ -preprocessor_use_gl_renderer- -preprocessor_evaluate_filter+" 
     4COMMAND="../scripts/preprocessor.sh -preprocessor_quit_on_finish+ -preprocessor_use_gl_renderer+ -preprocessor_evaluate_filter+" 
    55 
    66#SCENE="../data/vienna/vienna-buildings.x3d;../data/vienna/vienna-roofs.x3d;../data/vienna/vienna-roads.x3d" 
     
    1414#VIEWCELLS=../data/PowerPlant/power_plant_viewcells1.xml 
    1515 
    16 #SCENE=../data/soda/soda.dat 
     16#SCENE=../data/soda/soda5.dat 
     17#VIEWCELLS=../data/soda/soda-viewcells-5000.xml 
    1718#VIEWCELLS=../data/soda/soda5-viewcells.xml 
    18 #VIEWCELLS=../data/soda/soda-viewcells-5000.xml 
    1919#VIEWCELLS=../data/soda/soda5-viewcells-single.xml 
    2020 
Note: See TracChangeset for help on using the changeset viewer.