Changeset 2723 for GTP/trunk/Lib/Vis
- Timestamp:
- 05/28/08 04:02:18 (17 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/scripts/run_demo_vienna
r2722 r2723 8 8 9 9 10 SCENE=../data/vienna/vienna_cropped.obj10 #SCENE=../data/vienna/vienna_cropped.obj 11 11 #SCENE=../data/vienna/city_full.obj 12 #SCENE=../data/vienna/city_full_hp.obj12 SCENE=../data/vienna/city_full_hp.obj 13 13 #SCENE=../data/vienna/vienna_rep.obj 14 14 15 15 VIEWCELLS=../data/vienna/vienna_cropped-gradient-viewcells.xml.gz 16 16 #VIEWCELLS=../data/vienna/vienna_cropped-seq-3000-false-20-viewcells.xml.gz 17 #VIEWCELLS=../data/vienna/vienna_cropped-57000-viewcells.xml.gz17 VIEWCELLS=../data/vienna/vienna_cropped-57000-viewcells.xml.gz 18 18 VIEWPOINTS=../data/vienna/testwalk.vp 19 19 … … 40 40 -preprocessor_detect_empty_viewspace+ \ 41 41 -preprocessor_use_vbos- \ 42 -preprocessor_ray_cast_method= 1\42 -preprocessor_ray_cast_method=3 \ 43 43 -view_cells_random_viewpoint_list=$VIEWPOINTS \ 44 44 demo1.env -
GTP/trunk/Lib/Vis/Preprocessing/scripts/run_gvs_vps.sh
r2722 r2723 2 2 3 3 # add bin to path 4 export PATH=../bin: ../:$PATH4 export PATH=../bin:$PATH 5 5 6 6 #TARGET=debug … … 11 11 echo "starting $TARGET version" 12 12 13 SCENE=../data/Arena/arena-high-lods.obj14 SCENE=../data/Arena/arena_trees.obj 15 VIEWCELLS=../data/Arena/arena-high-lods-5000-viewcells.xml.gz 16 SCENE=../data/vienna/vienna_cropped.obj17 #SCENE=../data/vienna/city_full_hp.obj13 #SCENE=../data/Arena/arena-high-lods.obj 14 #VIEWCELLS=../data/Arena/arena-high-lods-5000-viewcells.xml.gz 15 #SCENE=../data/vienna/vienna_cropped.obj 16 #SCENE=../data/roofs_new.obj 17 SCENE=../data/vienna/city_full_hp.obj 18 18 #SCENE=../data/vienna/vienna_rep.obj 19 19 20 20 21 #SCENE=../data/vienna/vienna_cropped.obj 21 #VIEWCELLS=../data/vienna/vienna_cropped-gradient-viewcells.xml.gz 22 #VIEWPOINTS=../data/vienna/testwalk.vp 23 VIEWPOINTS=../data/arena/arena_key.vp 22 VIEWCELLS=../data/vienna/vienna_cropped-gradient-viewcells.xml.gz 23 VIEWPOINTS=../data/vienna/testwalk.vp 24 24 25 25 #LOG_PREFIX=../src/SG08/rebut-arena-pixel2 26 26 #LOG_PREFIX=../src/SG08/full 27 LOG_PREFIX=../src/SG08/ arena_trees27 LOG_PREFIX=../src/SG08/city_full 28 28 29 29 ENVIRONMENT=gvs.env … … 42 42 -gvs_samples_per_pass=1000000 \ 43 43 -gvs_initial_samples=16 \ 44 -gvs_max_viewcells= 20000 \45 -gvs_min_contribution= 4000 \44 -gvs_max_viewcells=5000 \ 45 -gvs_min_contribution=500 \ 46 46 -gvs_per_viewcell=true \ 47 47 -preprocessor_detect_empty_viewspace+ \ -
GTP/trunk/Lib/Vis/Preprocessing/src/AxisAlignedBox3.cpp
r2720 r2723 2162 2162 Triangle3 tri; 2163 2163 2164 tri.mVertices[ 0] = Vector3(mMin.x, mMin.y, mMax.z);2164 tri.mVertices[2] = Vector3(mMin.x, mMin.y, mMax.z); 2165 2165 tri.mVertices[1] = Vector3(mMin.x, mMax.y, mMax.z); 2166 tri.mVertices[ 2] = Vector3(mMin.x, mMax.y ,mMin.z);2166 tri.mVertices[0] = Vector3(mMin.x, mMax.y ,mMin.z); 2167 2167 2168 2168 triObj = new TriangleIntersectable(tri); 2169 2169 triangles.push_back(triObj); 2170 2170 2171 tri.mVertices[ 0] = Vector3(mMin.x, mMax.y ,mMin.z);2171 tri.mVertices[2] = Vector3(mMin.x, mMax.y ,mMin.z); 2172 2172 tri.mVertices[1] = Vector3(mMin.x, mMin.y, mMin.z); 2173 tri.mVertices[ 2] = Vector3(mMin.x, mMin.y, mMax.z);2173 tri.mVertices[0] = Vector3(mMin.x, mMin.y, mMax.z); 2174 2174 2175 2175 triObj = new TriangleIntersectable(tri); 2176 2176 triangles.push_back(triObj); 2177 2177 2178 tri.mVertices[0] = Vector3(mMax.x, mMin.y, mMin.z); 2178 ////////////////////////////////////// 2179 2180 tri.mVertices[2] = Vector3(mMax.x, mMin.y, mMin.z); 2179 2181 tri.mVertices[1] = Vector3(mMax.x, mMax.y, mMin.z); 2180 tri.mVertices[ 2] = Vector3(mMax.x, mMax.y, mMax.z);2182 tri.mVertices[0] = Vector3(mMax.x, mMax.y, mMax.z); 2181 2183 2182 2184 triObj = new TriangleIntersectable(tri); 2183 2185 triangles.push_back(triObj); 2184 2186 2185 tri.mVertices[ 0] = Vector3(mMax.x, mMax.y, mMax.z);2187 tri.mVertices[2] = Vector3(mMax.x, mMax.y, mMax.z); 2186 2188 tri.mVertices[1] = Vector3(mMax.x, mMin.y, mMax.z); 2187 tri.mVertices[ 2] = Vector3(mMax.x, mMin.y, mMin.z);2189 tri.mVertices[0] = Vector3(mMax.x, mMin.y, mMin.z); 2188 2190 2189 2191 triObj = new TriangleIntersectable(tri); 2190 2192 triangles.push_back(triObj); 2191 2193 2192 tri.mVertices[0] = Vector3(mMax.x, mMin.y ,mMin.z); 2194 ////////////////////////////////////// 2195 2196 tri.mVertices[2] = Vector3(mMax.x, mMin.y ,mMin.z); 2193 2197 tri.mVertices[1] = Vector3(mMax.x, mMin.y, mMax.z); 2194 tri.mVertices[ 2] = Vector3(mMin.x, mMin.y, mMax.z);2198 tri.mVertices[0] = Vector3(mMin.x, mMin.y, mMax.z); 2195 2199 2196 2200 triObj = new TriangleIntersectable(tri); 2197 2201 triangles.push_back(triObj); 2198 2202 2199 tri.mVertices[ 0] = Vector3(mMin.x, mMin.y, mMax.z);2203 tri.mVertices[2] = Vector3(mMin.x, mMin.y, mMax.z); 2200 2204 tri.mVertices[1] = Vector3(mMin.x, mMin.y, mMin.z); 2201 tri.mVertices[2] = Vector3(mMax.x, mMin.y ,mMin.z); 2202 2205 tri.mVertices[0] = Vector3(mMax.x, mMin.y ,mMin.z); 2203 2206 2204 2207 triObj = new TriangleIntersectable(tri); 2205 2208 triangles.push_back(triObj); 2206 2209 2207 tri.mVertices[0] = Vector3(mMin.x, mMax.y, mMin.z); 2210 ////////////////////////////////////// 2211 2212 tri.mVertices[2] = Vector3(mMin.x, mMax.y, mMin.z); 2208 2213 tri.mVertices[1] = Vector3(mMin.x, mMax.y, mMax.z); 2209 tri.mVertices[ 2] = Vector3(mMax.x, mMax.y, mMax.z);2214 tri.mVertices[0] = Vector3(mMax.x, mMax.y, mMax.z); 2210 2215 2211 2216 triObj = new TriangleIntersectable(tri); 2212 2217 triangles.push_back(triObj); 2213 2218 2214 tri.mVertices[ 0] = Vector3(mMax.x, mMax.y, mMax.z);2219 tri.mVertices[2] = Vector3(mMax.x, mMax.y, mMax.z); 2215 2220 tri.mVertices[1] = Vector3(mMax.x, mMax.y, mMin.z); 2216 tri.mVertices[ 2] = Vector3(mMin.x, mMax.y, mMin.z);2221 tri.mVertices[0] = Vector3(mMin.x, mMax.y, mMin.z); 2217 2222 2218 2223 triObj = new TriangleIntersectable(tri); 2219 2224 triangles.push_back(triObj); 2220 2225 2221 tri.mVertices[0] = Vector3(mMin.x, mMax.y, mMin.z); 2226 ////////////////////////////////////// 2227 2228 tri.mVertices[2] = Vector3(mMin.x, mMax.y, mMin.z); 2222 2229 tri.mVertices[1] = Vector3(mMax.x, mMax.y, mMin.z); 2223 tri.mVertices[2] = Vector3(mMax.x, mMin.y, mMin.z); 2224 2230 tri.mVertices[0] = Vector3(mMax.x, mMin.y, mMin.z); 2225 2231 2226 2232 triObj = new TriangleIntersectable(tri); 2227 2233 triangles.push_back(triObj); 2228 2234 2229 tri.mVertices[ 0] = Vector3(mMax.x, mMin.y, mMin.z);2235 tri.mVertices[2] = Vector3(mMax.x, mMin.y, mMin.z); 2230 2236 tri.mVertices[1] = Vector3(mMin.x, mMin.y, mMin.z); 2231 tri.mVertices[ 2] = Vector3(mMin.x, mMax.y, mMin.z);2237 tri.mVertices[0] = Vector3(mMin.x, mMax.y, mMin.z); 2232 2238 2233 2239 triObj = new TriangleIntersectable(tri); 2234 2240 triangles.push_back(triObj); 2235 2241 2236 tri.mVertices[0] = Vector3(mMin.x, mMin.y, mMax.z); 2242 ////////////////////////////////////// 2243 2244 tri.mVertices[2] = Vector3(mMin.x, mMin.y, mMax.z); 2237 2245 tri.mVertices[1] = Vector3(mMax.x, mMin.y, mMax.z); 2238 tri.mVertices[ 2] = Vector3(mMax.x, mMax.y, mMax.z);2246 tri.mVertices[0] = Vector3(mMax.x, mMax.y, mMax.z); 2239 2247 2240 2248 … … 2242 2250 triangles.push_back(triObj); 2243 2251 2244 tri.mVertices[ 0] = Vector3(mMax.x, mMax.y, mMax.z);2252 tri.mVertices[2] = Vector3(mMax.x, mMax.y, mMax.z); 2245 2253 tri.mVertices[1] = Vector3(mMin.x, mMax.y, mMax.z); 2246 tri.mVertices[ 2] = Vector3(mMin.x, mMin.y, mMax.z);2254 tri.mVertices[0] = Vector3(mMin.x, mMin.y, mMax.z); 2247 2255 2248 2256 triObj = new TriangleIntersectable(tri); -
GTP/trunk/Lib/Vis/Preprocessing/src/CombinedPreprocessor.cpp
r2709 r2723 133 133 if (mCurrentSamples - lastEvaluation >= mSamplesPerEvaluation) { 134 134 Real time = TimeDiff(startTime, GetTime()); 135 #if 0 // matt: remove temporarily 135 136 mViewCellsManager->PrintPvsStatistics(mStats); 137 #endif 136 138 mStats << 137 139 "#Pass\n" <<mPass<<endl<< -
GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.h
r2709 r2723 70 70 { 71 71 mViewCell = NULL; 72 mPvs.Clear( );72 mPvs.Clear(false); 73 73 filteredBoxes.clear(); 74 74 mUnfilteredPvsSize = 0; -
GTP/trunk/Lib/Vis/Preprocessing/src/ObjectPvs.cpp
r2670 r2723 161 161 162 162 Intersectable::NewMail2(); 163 //KdNode::NewMail(); 164 dummyPvs.Clear(); 165 163 166 164 ObjectPvsIterator pit = GetIterator(); 167 165 … … 196 194 } 197 195 196 198 197 } -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r2722 r2723 1702 1702 float renderCost = 0; 1703 1703 int i = 0; 1704 cout<<"size: " << vc->GetPvs().GetSize() << endl;1704 1705 1705 // first mark all objects from this pvs 1706 1706 while (pit.HasMoreEntries()) … … 1731 1731 //} 1732 1732 } 1733 else if (obj->Type() == Intersectable::SCENEGRAPHLEAF_INTERSECTABLE) 1734 { 1735 renderCost += (float)static_cast<SceneGraphLeafIntersectable *>(obj)->GetItem()->mGeometry.size(); 1736 } 1737 1733 1738 } 1734 1739 … … 1759 1764 for (vit = mViewCellsManager->GetViewCells().begin(); vit != vit_end; ++ vit) 1760 1765 { 1761 ObjectPvs &pvs = (*vit)->GetPvs(); 1766 ViewCell *vc = *vit; 1767 ObjectPvs &pvs = vc->GetPvs(); 1762 1768 1763 1769 bool pvsChanged = false; 1764 1770 1765 if (Overlap(box, (*vit)->GetBox()))1771 if (Overlap(box, vc->GetBox())) 1766 1772 { 1767 1773 pvs.Clear(); … … 1771 1777 else 1772 1778 { 1773 // cout<<(*vit)->GetBox()<<" "<<box<<endl;1774 shadowVolume.Init( (*vit)->GetBox(), box);1779 //cout<<vc->GetBox()<<" "<<box<<endl; 1780 shadowVolume.Init(vc->GetBox(), box); 1775 1781 if (shadowVolume.CntPlanes() > maxPlanes) 1776 1782 maxPlanes = shadowVolume.CntPlanes(); … … 1816 1822 if (pvsChanged) 1817 1823 { 1818 ViewCell *vc = *vit;1819 1820 1824 // recompute render cost 1821 1825 float renderCost = _HackComputeRenderCost(vc); -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp
r2721 r2723 58 58 static int sNextSamplesThreshold[] = {10000000, 50000000, 100000000, 250000000}; 59 59 //static int sNextSamplesThreshold[] = {100000000, 200000000}; 60 static int sNumReplays = 4;60 static int sNumReplays = 0;//4; 61 61 static int sCurrentSamplesThreshold = 0; 62 62 … … 353 353 //glReadBuffer(GL_FRONT); 354 354 355 cout << "here34" << endl;356 355 ////////////// 357 356 //-- output error visualization … … 387 386 388 387 // render pvs once 389 //RenderPvs(pvs); 390 RenderTrianglePvs(); 388 RenderPvs(pvs); 389 // hack for gvs vis 390 //RenderTrianglePvs(); 391 391 392 392 glFlush(); … … 1348 1348 AxisAlignedBox3 sceneBox = mViewCellsManager->GetViewSpaceBox(); 1349 1349 1350 float x = 1.0f; 1350 //float x = 1.0f; 1351 //float y = 20.0f; 1352 //float z = 80.0f; 1353 1354 float x = 20.0f; 1351 1355 float y = 20.0f; 1352 float z = 80.0f;1356 float z = 20.0f; 1353 1357 1354 1358 AxisAlignedBox3 box(Vector3(0.5f * x, 0, -0.5f * z), Vector3(-0.5f * x, y, 0.5f * z)); … … 1741 1745 1742 1746 ComputeMaxValues(viewcells, maxPvs, maxPiercingRays, maxRelativeRays, maxRcCost); 1743 1744 // matt: temp hack1745 //maxRcCost = 5000.0f;1746 1747 //cout << "maxRcCost: " << maxRcCost << endl; 1747 1748 1748 int i; 1749 // set the max render cost to fixed value 1750 //maxRcCost = 1000.0f; 1749 1751 1750 1752 // transparency … … 1762 1764 //glBlendFunc(GL_SRC_ALPHA, GL_ONE); 1763 1765 1764 for (i = 0; i < viewcells.size(); ++ i)1766 for (int i = 0; i < viewcells.size(); ++ i) 1765 1767 { 1766 1768 ViewCell *vc = viewcells[i]; … … 1779 1781 if (mUseStandardColors) 1780 1782 { 1781 for (i = 0; i < viewcells.size(); ++ i)1783 for (int i = 0; i < viewcells.size(); ++ i) 1782 1784 { 1783 1785 ViewCell *vc = viewcells[i]; -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r2720 r2723 375 375 if (index >= mPreprocessor->mObjects.size()) 376 376 { 377 // Do nothing378 return NULL;377 // do nothing 378 //return NULL; 379 379 for (size_t i = 0; i < mPreprocessor->mDynamicObjects.size(); ++ i) 380 380 { … … 383 383 return obj; 384 384 } 385 386 return ray.mTerminationObject; 385 386 // no dynamic object found 387 return NULL;//ray.mTerminationObject; 387 388 } 388 389 … … 2426 2427 bool addSamplesToPvs) 2427 2428 { 2428 // check if we are outside of view space 2429 // $$JB tmp commented to speedup up computations 2430 #if 0 2431 if (!obj || !viewCell->GetValid()) 2429 if (!obj) 2432 2430 return false; 2433 #endif2434 2431 2435 2432 // if ray not outside of view space … … 2527 2524 vssRay->mTerminationObject = GetIntersectable(*vssRay, true); 2528 2525 2529 if (vssRay->mTerminationObject->Type() == Intersectable::TRANSFORMED_MESH_INSTANCE) 2530 cout << "r"; 2531 2532 #if 0 2533 if (vssRay->mTerminationObject == NULL) 2534 cerr<<"Error in DeterminePvsObjects - termination object maps to NULL!"<<endl; 2535 #endif 2526 if (0 && (vssRay->mTerminationObject == NULL)) 2527 cerr<<"Error in DeterminePvsObjects - termination object maps to NULL!"<<endl; 2528 2536 2529 } 2537 2530 }
Note: See TracChangeset
for help on using the changeset viewer.