- Timestamp:
- 06/02/08 19:02:06 (17 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/scripts/run_gvs_vps.sh
r2729 r2730 42 42 -gvs_total_samples=1000000 \ 43 43 -gvs_samples_per_pass=1000000 \ 44 -gvs_initial_samples= 4\45 -gvs_max_viewcells= 2\44 -gvs_initial_samples=1 \ 45 -gvs_max_viewcells=3 \ 46 46 -gvs_min_contribution=500 \ 47 47 -gvs_per_viewcell=true \ -
GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp
r2727 r2730 1563 1563 { 1564 1564 mPvsStat.Reset(); 1565 ++ mPvsStat. pass;1565 ++ mPvsStat.currentPass; 1566 1566 1567 1567 SetupProjection(GetWidth(), GetHeight()); … … 1572 1572 1573 1573 int i = 0; 1574 1575 1574 // $matt tmp: somehow this is not properly initialised 1576 1575 //ClearErrorBuffer(); … … 1579 1578 { 1580 1579 SimpleRay sray = *sit; 1581 1582 1580 int pvsSize = -1; 1583 1581 … … 1593 1591 { 1594 1592 // compute the pixel error 1595 mPvsErrorBuffer[i].mError = GetPixelError(pvsSize, mPvsStat. pass);1593 mPvsErrorBuffer[i].mError = GetPixelError(pvsSize, mPvsStat.currentPass); 1596 1594 mPvsErrorBuffer[i].mPvsSize = pvsSize; 1597 1595 -
GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.h
r2723 r2730 42 42 int frames; 43 43 int errorFreeFrames; 44 int pass;45 46 PvsRenderStatistics(): pass(0) { Reset(); }44 int currentPass; 45 46 PvsRenderStatistics(): currentPass(0) { Reset(); } 47 47 48 48 void Reset() … … 53 53 errorFreeFrames = 0; 54 54 sumPvsSize = 0; 55 //cuurentPass = 0; 55 56 } 56 57 … … 171 172 172 173 /** Gets the pixel error of the current view point. 173 174 175 174 returns the size of the pvs for the current view point. pass returns the 175 current pass of the evaluation. 176 */ 176 177 virtual float GetPixelError(int &pvsSize, int pass); 177 178 -
GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp
r2729 r2730 14 14 #include "IntersectableWrapper.h" 15 15 #include "Timer/PerfTimer.h" 16 #include "Vector2.h" 17 #include "RndGauss.h" 18 16 19 17 20 … … 1326 1329 // export the preprocessed information to a file 1327 1330 if (0 && mExportVisibility) 1328 {1329 1331 ExportPreprocessedData(mVisibilityFileName); 1330 }1331 1332 1332 1333 // compute the pixel error of this visibility solution 1333 if (mEvaluatePixelError) 1334 { 1334 if (0 && mEvaluatePixelError) 1335 1335 ComputeRenderError(); 1336 }1337 1336 1338 1337 return true; … … 1424 1423 mGvsStats.mGvsSamples = 0; 1425 1424 1425 //renderer->mPvsStat.currentPass = 0; 1426 mPass = 0; 1427 1426 1428 int oldContribution = 0; 1427 1429 int passSamples = 0; … … 1507 1509 mGvsStats.mPassContribution = 0; 1508 1510 passSamples = 0; 1511 1512 // compute the pixel error of this visibility solution 1513 if (mEvaluatePixelError) 1514 ComputeRenderError(); 1509 1515 } 1510 1516 } … … 1627 1633 cout << "raw cast time : " << rawCastTime << endl; 1628 1634 1629 float randomRaysPerSec = mGvsStats.mRandomSamples / (1e6f* initialTime);1630 float gvsRaysPerSec = mGvsStats.mGvsSamples / (1e6f* gvsTime);1631 float rawRaysPerSec = mGvsStats.mPerViewCellSamples / (1e6f* rawCastTime);1635 double randomRaysPerSec = mGvsStats.mRandomSamples / (1e6 * initialTime); 1636 double gvsRaysPerSec = mGvsStats.mGvsSamples / (1e6 * gvsTime); 1637 double rawRaysPerSec = mGvsStats.mPerViewCellSamples / (1e6 * rawCastTime); 1632 1638 1633 1639 cout << "cast " << randomRaysPerSec << " M random rays/s: " << endl; … … 1804 1810 } 1805 1811 1806 } 1812 1813 void GvsPreprocessor::ComputeRenderError() 1814 { 1815 // compute rendering error 1816 if (renderer && renderer->mPvsStatFrames) 1817 { 1818 if (!mViewCellsManager->GetViewCellPointsList()->empty()) 1819 { 1820 ViewCellPointsList *vcPoints = mViewCellsManager->GetViewCellPointsList(); 1821 ViewCellPointsList::const_iterator vit = vcPoints->begin(), vit_end = vcPoints->end(); 1822 1823 SimpleRayContainer viewPoints; 1824 1825 for (; vit != vit_end; ++ vit) 1826 { 1827 ViewCellPoints *vp = *vit; 1828 1829 SimpleRayContainer::const_iterator rit = vp->second.begin(), rit_end = vp->second.end(); 1830 1831 for (; rit!=rit_end; ++rit) 1832 { 1833 ViewCell *vc = mViewCellsManager->GetViewCell((*rit).mOrigin); 1834 if (vc == mCurrentViewCell) 1835 viewPoints.push_back(*rit); 1836 } 1837 } 1838 1839 renderer->mPvsErrorBuffer.clear(); 1840 1841 if (viewPoints.size() != renderer->mPvsErrorBuffer.size()) 1842 { 1843 renderer->mPvsErrorBuffer.resize(viewPoints.size()); 1844 renderer->ClearErrorBuffer(); 1845 } 1846 1847 cout << "evaluating list of " << viewPoints.size() << " pts" << endl; 1848 renderer->EvalPvsStat(viewPoints); 1849 } 1850 else 1851 { 1852 cout << "evaluating random points" << endl; 1853 renderer->EvalPvsStat(); 1854 } 1855 1856 mStats << 1857 "#AvgPvsRenderError\n" <<renderer->mPvsStat.GetAvgError()<<endl<< 1858 "#AvgPixelError\n" <<renderer->GetAvgPixelError()<<endl<< 1859 "#MaxPixelError\n" <<renderer->GetMaxPixelError()<<endl<< 1860 "#MaxPvsRenderError\n" <<renderer->mPvsStat.GetMaxError()<<endl<< 1861 "#ErrorFreeFrames\n" <<renderer->mPvsStat.GetErrorFreeFrames()<<endl<< 1862 "#AvgRenderPvs\n" <<renderer->mPvsStat.GetAvgPvs()<<endl; 1863 } 1864 } 1865 1866 1867 SimpleRay GvsPreprocessor::GenerateJitteredSample(const SimpleRay &sray) 1868 { 1869 // mutate the origin 1870 Vector3 d = sray.mDirection; 1871 1872 // Compute right handed coordinate system from direction 1873 Vector3 U, V; 1874 d.RightHandedBase(U, V); 1875 1876 float rr[2]; 1877 1878 rr[0] = RandomValue(0, 1); 1879 rr[1] = RandomValue(0, 1); 1880 1881 Vector2 vr2(rr[0], rr[1]); 1882 Vector2 gaussvec2; 1883 1884 const float sigma = 0.2f; 1885 1886 GaussianOn2D(vr2, sigma, // input 1887 gaussvec2); // output 1888 1889 Vector3 shift = gaussvec2.xx * U + gaussvec2.yy * V; 1890 1891 d += shift; 1892 1893 d.Normalize(); 1894 1895 return SimpleRay(sray.mOrigin, d, SamplingStrategy::GVS, 1.0f); 1896 } 1897 1898 1899 } -
GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.h
r2729 r2730 272 272 void CastRayBundle16(const SimpleRay &ray, VssRayContainer &vssRays); 273 273 274 virtual void ComputeRenderError(); 275 276 SimpleRay GenerateJitteredSample(const SimpleRay &ray); 277 274 278 275 279 ////////////////////// -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp
r2725 r2730 174 174 void QtGlRendererBuffer::RenderTrianglePvs() 175 175 { 176 //Intersectable::NewMail; 177 176 178 ObjectContainer::const_iterator oit, oit_end = 177 179 mViewCellsManager->GetPreprocessor()->mTrianglePvs.end(); … … 179 181 //int sz = mViewCellsManager->GetPreprocessor()->mDummyBuffer.size(); 180 182 181 int i = 0;182 183 for (oit = mViewCellsManager->GetPreprocessor()->mTrianglePvs.begin(); 183 oit != oit_end; ++ oit, ++ i) 184 { 184 oit != oit_end; ++ oit) 185 { 186 TriangleIntersectable *triObj = static_cast<TriangleIntersectable *>(*oit); 187 185 188 //int dum = mViewCellsManager->GetPreprocessor()->mDummyBuffer[i]; 186 189 //glColor3f(0, (float)dum / 20.0f, 1); 187 if (mUseFalseColors) SetupFalseColor((*oit)->mId); 188 189 RenderIntersectable(*oit); 190 if (mUseFalseColors) SetupFalseColor(triObj->mId); 191 192 RenderIntersectable(triObj); 193 194 /*if (!triObj->Mailed()) 195 triObj->Mail(); 196 else 197 cerr << "böser fehler" << endl; 198 */ 190 199 } 191 200 } … … 194 203 195 204 // reimplemented here so that we can snap the error windows 196 float QtGlRendererBuffer::GetPixelError(int &pvsSize, int pass)205 float QtGlRendererBuffer::GetPixelError(int &pvsSize, int currentPass) 197 206 { 198 207 MakeLive(); … … 301 310 302 311 KdNode::NewMail2(); 303 Intersectable::NewMail(); 304 312 //Intersectable::NewMail(); 313 314 //mUseFalseColors = true; 315 // hack for gvs 316 RenderTrianglePvs(); 305 317 // render pvs once 306 RenderPvs(pvs);318 //RenderPvs(pvs); 307 319 308 320 //glColorMask(GL_TRUE, GL_FALSE, GL_FALSE, GL_FALSE); … … 320 332 321 333 KdNode::NewMail2(); 322 Intersectable::NewMail();334 //Intersectable::NewMail(); 323 335 324 336 query->BeginQuery(); … … 357 369 //sprintf(filename, "error-frame-%04d-%05d.bmp", pass, mFrame); 358 370 //sprintf(filename, "error-frame-%05d-%0.5f.png", mFrame, pErrorPixels); 359 sprintf_s(filename, "error-frame-%05d-%0 4d-%08d.png", mFrame, viewcell->GetId(), pixelCount);371 sprintf_s(filename, "error-frame-%05d-%05d-%08d.png", viewcell->GetId(), mFrame, pixelCount); 360 372 361 373 QImage im = toImage(); … … 379 391 380 392 KdNode::NewMail2(); 381 Intersectable::NewMail();393 //Intersectable::NewMail(); 382 394 383 395 ++ mCurrentFrame; … … 385 397 // render pvs once 386 398 RenderPvs(pvs); 387 // hack for gvs vis 399 // hack for gvs visualization 388 400 //RenderTrianglePvs(); 389 401 -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.h
r2725 r2730 76 76 int ComputePvs(ObjectContainer &objects, ObjectContainer &pvs) const; 77 77 78 /** quick hack in order to be able to render gvs pvs.78 /** quick hack in order to be able to render gvs based triangle pvs. 79 79 */ 80 80 void RenderTrianglePvs();
Note: See TracChangeset
for help on using the changeset viewer.