- Timestamp:
- 01/24/07 06:53:09 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp
r2049 r2050 117 117 { 118 118 Triangle3 &t = object->GetItem(); 119 119 120 120 glBegin(GL_TRIANGLES); 121 121 Vector3 normal = t.GetNormal(); … … 130 130 GlRenderer::RenderIntersectable(Intersectable *object) 131 131 { 132 if (!object) 133 return; 134 132 135 if (object->Mailed()) 133 136 return; 137 134 138 object->Mail(); 135 139 … … 1389 1393 void GlRenderer::EvalPvsStat(const SimpleRayContainer &viewPoints) 1390 1394 { 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) 1416 1418 { 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 <<")"; 1427 1428 } 1428 1429 if (mPvsErrorBuffer[i].mError > 0.0f) 1429 1430 err = mPvsErrorBuffer[i].mError; 1431 1432 if (err >= 0.0f) 1430 1433 { 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; 1450 1438 mPvsStat.sumPvsSize += mPvsErrorBuffer[i].mPvsSize; 1451 1439 1452 1440 if (err == 0.0f) 1453 1454 1441 ++ mPvsStat.errorFreeFrames; 1442 1455 1443 ++ mPvsStat.frames; 1456 1444 } 1457 1445 } 1458 1459 1460 1446 1447 glFinish(); 1448 cout << endl << flush; 1461 1449 } 1462 1450 -
GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.h
r2048 r2050 199 199 friend class ViewCellsManager; 200 200 201 vector<PvsErrorEntry> mPvsErrorBuffer; 202 201 203 protected: 202 204 203 205 204 vector<PvsErrorEntry> mPvsErrorBuffer;205 206 206 207 PvsCache mPvsCache; -
GTP/trunk/Lib/Vis/Preprocessing/src/Mutation.cpp
r2048 r2050 20 20 #define USE_SILHOUETTE_MUTATIONS 0 21 21 22 #define SIL_TERMINATION_MUTATION_PROB 0.9f 22 23 #define SIL_TERMINATION_MUTATION_PROB 0.8f 23 24 24 25 #define EVALUATE_MUTATION_STATS 1 -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r2049 r2050 1461 1461 vector<ViewCellPoints *> *vcPoints = mViewCellsManager->GetViewCellPoints(); 1462 1462 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 1464 1467 SimpleRayContainer viewPoints; 1465 1468 1466 for ( vit = vcPoints->begin(); vit != vit_end; ++ vit) {1469 for (; vit != vit_end; ++ vit) { 1467 1470 ViewCellPoints *vp = *vit; 1468 1471 … … 1471 1474 viewPoints.push_back(*rit); 1472 1475 } 1473 1476 1477 if (viewPoints.size() != renderer->mPvsErrorBuffer.size()) { 1478 renderer->mPvsErrorBuffer.resize(viewPoints.size()); 1479 renderer->ClearErrorBuffer(); 1480 } 1481 1474 1482 renderer->EvalPvsStat(viewPoints); 1475 1483 } else 1476 1484 renderer->EvalPvsStat(); 1477 1485 1478 1486 mStats << 1479 1487 "#AvgPvsRenderError\n" <<renderer->mPvsStat.GetAvgError()<<endl<< -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp
r2049 r2050 89 89 float pErrorPixels = -1.0f; 90 90 91 glReadBuffer(GL_BACK);92 93 // mUseFalseColors = true;94 91 95 92 mUseFalseColors = false; 96 93 unsigned int pixelCount; 97 94 98 95 99 96 ViewCell *viewcell = mViewCellsManager->GetViewCell(mViewPoint); 100 97 // cout<<"View cell"<<viewcell<<endl; 101 98 if (viewcell == NULL) 102 99 return 0.0f; … … 119 116 pvs); 120 117 } 121 118 119 // cout<<"pvs size"<<pvs.GetSize()<<endl<<flush; 120 122 121 SetupCamera(); 123 122 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); … … 138 137 RenderIntersectable(object); 139 138 } 140 139 140 141 141 // glColorMask(GL_TRUE, GL_FALSE, GL_FALSE, GL_FALSE); 142 142 glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); … … 162 162 // } 163 163 164 164 165 pixelCount = query->GetQueryResult(); 165 166 … … 167 168 168 169 169 if (0 && mSnapErrorFrames && pErrorPixels >= 0.01f) { 170 170 if (mSnapErrorFrames && pErrorPixels >= 0.01f) { 171 glReadBuffer(GL_BACK); 172 171 173 char filename[256]; 172 174 sprintf(filename, "error-frame-%04d-%0.5f.png", mFrame, pErrorPixels); -
GTP/trunk/Lib/Vis/Preprocessing/src/default.env
r2049 r2050 61 61 # type render 62 62 detectEmptyViewSpace true 63 pvsRenderErrorSamples 063 pvsRenderErrorSamples 20 64 64 # pvsRenderErrorSamples 10000 65 65 quitOnFinish false
Note: See TracChangeset
for help on using the changeset viewer.