- Timestamp:
- 01/12/09 19:03:24 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/default.env
r3270 r3271 9 9 #filename=vienna_full_hp 10 10 #filename=procedural_pompeii_area6_hires/pompeii_full 11 filename=procedural_pompeii_area6_hires/pompeii_part 111 filename=procedural_pompeii_area6_hires/pompeii_part 12 12 #filename=city 13 13 useLODs=1 … … 18 18 # the filename for the statistics 19 19 statsFilename=mystats.log 20 walkThroughSuffix=path_pp 20 21 21 22 # use potentially visible sets? … … 25 26 visibilitySolution=vienna_full-8x3-pgv 26 27 viewCellsScaleFactor=1.0f 27 useSkylightForIllum= 028 useSkylightForIllum=1 28 29 29 30 … … 120 121 ## powerplant options 121 122 122 #filename=PowerPlantM 123 #keyForwardMotion=500.0f 124 #mouseMotion=3.0f 123 # static geometry 124 filename=PowerPlantM 125 bvhname=PowerPlantM 126 keyForwardMotion=500.0f 127 mouseMotion=3.0f 125 128 #visibilitySolution=power-plant-2c-xx-1000b-pgv2 126 #camPosition=-1320.57 -6306.34 3603 127 #camDirection=0.292156 0.9556 0.0383878 128 #viewCellsScaleFactor=0.05f 129 visibilitySolution=power-plant-2c-xx-1000d-pgv 130 camPosition=-1320.57 -6306.34 3603 131 camDirection=0.292156 0.9556 0.0383878 132 viewCellsScaleFactor=0.05f 133 134 camPosition=763.554 -10254.5 2604 135 camDirection=-0.0975121 0.994494 0.0383878 136 useSkylightForIllum=1 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/plot_friendly
r3250 r3271 13 13 #FILES="$PREFIX-vfc.log $PREFIX-vfc_pvs.log $PREFIX-chc++.log $PREFIX-chc++_pvs.log" 14 14 #FILES="$PREFIX-chc++.log $PREFIX-chc++_b20.log" 15 FILES="$PREFIX-chc.log $PREFIX-vfc_pvs.log $PREFIX-vfc_pvs_smaller.log $PREFIX-chc++.log $PREFIX-chc++_pvs.log $PREFIX-chc++_pvs_smaller.log" 15 16 16 17 echo $FILES -
GTP/trunk/App/Demos/Vis/FriendlyCulling/ps_memory_plot2
r3250 r3271 23 23 #echo set xrange \[100:20000\] >> $FILE 24 24 #echo set xrange \[4200:4600\] >> $FILE 25 echo set xrange \[100:400\] >> $FILE 25 #echo set xrange \[100:400\] >> $FILE 26 echo set xrange \[1:1000\] >> $FILE 26 27 #echo set xrange \[1600:2000\] >> $FILE 27 28 # echo set boxwidth 0.4 >> $FILE -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Bvh.cpp
r3270 r3271 652 652 CollectNodes(mStaticRoot, nodes); 653 653 //CollectNodes(mRoot, nodes); 654 // also add root 655 nodes.push_back(mRoot); 654 656 655 657 cout << "creating new indices" << endl; … … 799 801 800 802 CollectNodes(mDynamicRoot, nodes); 803 // also add root 804 nodes.push_back(mRoot); 801 805 802 806 const unsigned int bufferSize = 8 * (int)nodes.size(); … … 813 817 814 818 for (int j = 0; j < 8; ++ j) 819 { 815 820 (static_cast<Vector3 *>(mVertices))[node->GetId() * 8 + j] = node->GetBox().GetVertex(j); 821 } 816 822 } 817 823 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/CHCPlusPlusTraverser.cpp
r3259 r3271 119 119 mDistanceQueue.pop(); 120 120 121 if (!IsNodeGeometryVisible(node, 10)) 122 { 121 if (0 && !IsNodeGeometryVisible(node, 10)) 122 { 123 // todo: find out why it is jumping 123 124 node->SetLastVisitedFrame(mFrameId); 124 125 node->SetVisible(false); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/FrustumCullingTraverser.cpp
r3258 r3271 17 17 mDistanceQueue.pop(); 18 18 19 if ( 1&& !IsNodeGeometryVisible(node, 10))19 if (0 && !IsNodeGeometryVisible(node, 10)) 20 20 { 21 21 node->SetVisible(false); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ResourceManager.cpp
r3261 r3271 315 315 316 316 deferred->GetFragmentProgramParameters()->SetViewMatrixParam(0); 317 318 317 deferred->GetVertexProgramParameters()->SetModelMatrixParam(1); 319 318 deferred->GetVertexProgramParameters()->SetOldModelMatrixParam(2); … … 425 424 426 425 cout << "loaded " << numTextures << " textures" << endl; 427 428 426 cout << "loading shapes (geometry + materials)" << endl; 429 427 … … 432 430 433 431 cout << "loaded " << (int)mGeometryTable.size() << " shapes" << endl; 434 435 432 cout << "loading scene entites" << endl; 436 433 … … 438 435 439 436 cout << "loaded " << numEntities << " scene entities" << endl; 440 441 437 cout << "bin loading finished" << endl; 442 438 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SceneEntityConverter.cpp
r3270 r3271 93 93 94 94 tex[0].first = 0; tex[0].second = 0; 95 tex[1].first = 1; tex[1].second = 0;96 tex[2].first = 1; tex[2].second = 1;95 tex[1].first = 50; tex[1].second = 0; 96 tex[2].first = 50; tex[2].second = 50; 97 97 98 98 tex[3].first = 0; tex[3].second = 0; 99 tex[4].first = 1; tex[4].second = 1;100 tex[5].first = 0; tex[5].second = 1;99 tex[4].first = 50; tex[4].second = 50; 100 tex[5].first = 0; tex[5].second = 50; 101 101 102 102 for (size_t i = 0; i < triangles.size(); ++ i) -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SkyPreetham.cpp
r3268 r3271 109 109 110 110 // scale the sky dome so no intersection with the scene is visible 111 const float scaleFactor = 80.0f;112 //const float scaleFactor = 500.0f;111 //const float scaleFactor = 80.0f; 112 const float scaleFactor = 1000.0f; 113 113 114 114 position.z -= 3.0f * scaleFactor; -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/StopAndWaitTraverser.cpp
r3259 r3271 22 22 mDistanceQueue.pop(); 23 23 24 if ( 1&& !IsNodeGeometryVisible(node, 10))24 if (0 && !IsNodeGeometryVisible(node, 10)) 25 25 { 26 26 node->SetVisible(false); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/VisibilitySolutionLoader.cpp
r3259 r3271 136 136 BvhNodeContainer nodes; 137 137 CreateIdSortedList(bvh, nodes); 138 138 139 139 for (int i = 0; i < number; ++ i) 140 140 { … … 148 148 fread(&objectId, sizeof(int), 1, fw); 149 149 fread(&time, sizeof(float), 1, fw); 150 150 151 151 BvhNode *node = nodes[objectId]; 152 153 152 mViewCells[i]->mPvs.AddEntry(bvh, node); 154 153 } -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
r3270 r3271 132 132 133 133 string filename("city"); 134 string bvhname(""); 134 135 string visibilitySolution(""); 135 136 … … 303 304 304 305 GLuint sunQuery = 0; 306 307 string walkThroughSuffix("frames"); 305 308 306 309 … … 455 458 456 459 env.GetStringParam(string("recordedFramesSuffix"), recordedFramesSuffix); 460 env.GetStringParam(string("walkThroughSuffix"), walkThroughSuffix); 457 461 env.GetStringParam(string("statsFilename"), statsFilename); 458 462 env.GetStringParam(string("filename"), filename); 463 env.GetStringParam(string("bvhname"), bvhname); 459 464 env.GetStringParam(string("visibilitySolution"), visibilitySolution); 460 465 … … 472 477 cout << "max batch size: " << maxBatchSize << endl; 473 478 cout << "triangles per virtual leaf: " << trianglesPerVirtualLeaf << endl; 479 480 cout << "static scene filename prefix: " << filename << endl; 481 cout << "bvh filename prefix: " << bvhname << endl; 474 482 475 483 cout << "key forward motion: " << keyForwardMotion << endl; … … 491 499 cout << "use ssao full resolution: " << ssaoUseFullResolution << endl; 492 500 cout << "recorded frames suffix: " << recordedFramesSuffix << endl; 501 cout << "walkthrough suffix: " << walkThroughSuffix << endl; 493 502 cout << "stats filename: " << statsFilename << endl; 494 cout << "static scene filename prefix: " << filename << endl;495 503 cout << "use PVSs: " << usePvs << endl; 496 504 cout << "visibility solution: " << visibilitySolution << endl; … … 587 595 //LoadModel("sibenik.dem", dynamicObjects); 588 596 597 #if 1 598 599 AxisAlignedBox3 pompeiiBox = SceneEntity::ComputeBoundingBox(staticObjects); 600 589 601 // todo: dispose texture 590 602 Texture *floorTex = new Texture(model_path + "stairs.c.01.tif"); … … 594 606 595 607 floorTex->Create(); 596 597 598 608 Material *mymat = resourceManager->CreateMaterial(); 599 609 600 mymat->GetTechnique(0)->SetDiffuse(RgbaColor(1, 1, 1, 1)); 601 mymat->GetTechnique(0)->SetTexture(floorTex); 602 603 const Vector3 offs(1300.0f, -2500.0f, .0f); 610 Technique *tech = mymat->GetDefaultTechnique(); 611 tech->SetDiffuse(RgbaColor(1, 1, 1, 1)); 612 tech->SetTexture(floorTex); 613 614 Technique *depthPass = new Technique(*tech); 615 Technique *deferred = new Technique(*tech); 616 617 depthPass->SetColorWriteEnabled(false); 618 depthPass->SetLightingEnabled(false); 619 620 ShaderProgram *defaultFragmentTexProgramMrt = ShaderManager::GetSingleton()->GetShaderProgram("defaultFragmentTexMrt"); 621 ShaderProgram *defaultVertexProgramMrt = ShaderManager::GetSingleton()->GetShaderProgram("defaultVertexMrt"); 622 623 deferred->SetFragmentProgram(defaultFragmentTexProgramMrt); 624 deferred->SetVertexProgram(defaultVertexProgramMrt); 625 626 deferred->GetFragmentProgramParameters()->SetViewMatrixParam(0); 627 deferred->GetVertexProgramParameters()->SetModelMatrixParam(1); 628 deferred->GetVertexProgramParameters()->SetOldModelMatrixParam(2); 629 630 deferred->SetTexture(floorTex); 631 632 mymat->AddTechnique(deferred); 633 mymat->AddTechnique(depthPass); 634 635 636 //const Vector3 offs(1300.0f, -2500.0f, .0f); 637 const Vector3 offs(pompeiiBox.Center(0), pompeiiBox.Center(1), 0); 604 638 Matrix4x4 moffs = TranslationMatrix(offs); 605 639 … … 609 643 SceneEntity *myplane = 610 644 SceneEntityConverter().ConvertPlane(plane, 611 500,612 500,645 pompeiiBox.Size(0), 646 pompeiiBox.Size(1), 613 647 5, 614 648 5, … … 618 652 resourceManager->AddSceneEntity(myplane); 619 653 staticObjects.push_back(myplane); 620 /*const float side = 400.0f; 621 AxisAlignedBox3 mybox(Vector3(-side, -side, -side), Vector3(side, side, side)); 622 623 Transform3 *mytrafo2 = resourceManager->CreateTransform(moffs); 624 625 SceneEntity *myboxEnt = 626 SceneEntityConverter().ConvertBox(mybox, mymat, mytrafo2); 627 628 staticObjects.push_back(myboxEnt); 629 resourceManager->AddSceneEntity(myboxEnt);*/ 654 655 #endif 630 656 631 657 #if 0 … … 667 693 //-- load the associated static bvh 668 694 669 const string bvh_filename = string(model_path + filename + ".bvh");670 671 695 BvhFactory bvhFactory; 672 #if 1 673 bvh = bvhFactory.Create(staticObjects, dynamicObjects, maxDepthForTestingChildren); 674 #else 675 bvh = bvhFactory.Create(bvh_filename, staticObjects, dynamicObjects, maxDepthForTestingChildren); 676 #endif 677 678 if (!bvh) 679 { 680 cerr << "loading bvh " << bvh_filename << " failed" << endl; 681 CleanUp(); 682 exit(0); 696 697 if (bvhname != "") 698 { 699 cout << "loading bvh from disc" << endl; 700 const string bvh_fullpath = string(model_path + bvhname + ".bvh"); 701 bvh = bvhFactory.Create(bvh_fullpath, staticObjects, dynamicObjects, maxDepthForTestingChildren); 702 703 if (!bvh) 704 { 705 cerr << "loading bvh " << bvh_fullpath << " failed" << endl; 706 CleanUp(); 707 exit(0); 708 } 709 } 710 else 711 { 712 cout << "creating new bvh" << endl; 713 bvh = bvhFactory.Create(staticObjects, dynamicObjects, maxDepthForTestingChildren); 683 714 } 684 715 … … 1198 1229 { 1199 1230 if (!walkThroughPlayer) 1200 walkThroughPlayer = new WalkThroughPlayer( "frames.log");1231 walkThroughPlayer = new WalkThroughPlayer(walkThroughSuffix + ".log"); 1201 1232 1202 1233 ++ currentReplayFrame; … … 1229 1260 { 1230 1261 if (!walkThroughRecorder) 1231 walkThroughRecorder = new WalkThroughRecorder( "frames.log");1262 walkThroughRecorder = new WalkThroughRecorder(walkThroughSuffix + ".log"); 1232 1263 1233 1264 if ((Distance(oldPos, camera->GetPosition()) > 1e-6f) || … … 2560 2591 { 2561 2592 const string filename = string(model_path + model); 2562 2563 2593 int numEntities = 0; 2564 2594 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaderenv.h
r3251 r3271 6 6 //-- ssao + gi parameters 7 7 8 #define NUM_SAMPLES 88 //#define NUM_SAMPLES 8 9 9 //#define NUM_SAMPLES 16 10 10 //#define NUM_SAMPLES 24 11 //#define NUM_SAMPLES 4811 #define NUM_SAMPLES 48 12 12 13 13 #define MIN_SAMPLES 8 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/combineSsao.cg
r3247 r3271 162 162 163 163 // the filtered ssao value 164 //ao.x = DiscontinuityFilter(IN.texCoord, ao, col, ssaoTex, normalsTex, colorsTex, filterOffs, scale, bl, br, tl, tr);164 ao.x = DiscontinuityFilter(IN.texCoord, ao, col, ssaoTex, normalsTex, colorsTex, filterOffs, scale, bl, br, tl, tr); 165 165 } 166 166 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
r3247 r3271 322 322 #endif 323 323 324 return float3(total_ao, validSamples, numSamples); 324 //return float3(total_ao, validSamples, numSamples); 325 return float3(min(1.0f, total_ao), validSamples, numSamples); 325 326 } 326 327
Note: See TracChangeset
for help on using the changeset viewer.