- Timestamp:
- 01/15/09 16:32:50 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/default.env
r3277 r3279 9 9 #filename=vienna_full_hp 10 10 #bvhname=vienna_full_hp 11 filename=tryvienna12 bvhname=tryvienna13 filename=mypompeii14 bvhname=mypompeii15 #filename=pompeii/pompeii_full11 #filename=tryvienna 12 #bvhname=tryvienna 13 #filename=mypompeii 14 #bvhname=mypompeii 15 filename=pompeii/pompeii_full 16 16 #filename=pompeii/pompeii_part 17 17 #filename=city … … 23 23 recordedFramesSuffix=image 24 24 # the filename for the statistics 25 statsFilename=mystats .log25 statsFilename=mystats 26 26 walkThroughSuffix=walkthrough_pp_1 27 27 #walkThroughSuffix=path_pp … … 32 32 # if using pvs, this specifies the name of the visibility solutin 33 33 #visibilitySolution=vienna_full-8x3-pgv 34 visibilitySolution=mypompeii-1x1-pgv 34 #visibilitySolution=mypompeii-1x1-pgv 35 visibilitySolution=mypompeii-2x1-obvh-pgv 36 #visibilitySolution=myvienna-3x1-obvh-pgv 35 37 36 38 viewCellsScaleFactor=1.0f 37 39 useSkylightForIllum=1 40 41 skyDomeScaleFactor=80.0f 38 42 39 43 … … 62 66 camPosition=483.398f 242.364f 186.078f 63 67 # pompeii view point 64 camPosition=1300.0f -2500.0f 10.0f68 #camPosition=1300.0f -2500.0f 10.0f 65 69 # pompeii problematic 66 70 #camPosition=627.003 -1725.33 25.2 … … 108 112 # skylight turbitity 109 113 turbitity=3.0f 114 #sky dome scale factor 110 115 111 116 … … 143 148 #camDirection=-0.0975121 0.994494 0.0383878 144 149 #useSkylightForIllum=1 150 #skyDomeScaleFactor=1000.0f -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/BvhExporter.cpp
r3274 r3279 21 21 22 22 int buffer[4]; 23 buffer[3] = currentIdx ++; 23 24 24 25 if (node->IsVirtualLeaf()) … … 29 30 buffer[1] = mTriangleRangeMap[leaf].second; 30 31 buffer[2] = -1;//leaf->GetAxis(); 31 buffer[3] = currentIdx ++; 32 32 33 33 fwrite(buffer, sizeof(int), 4, fw); 34 34 } … … 40 40 buffer[1] = interior->mLast; 41 41 buffer[2] = 0;//interior->mAxis; 42 buffer[3] = currentIdx ++;43 42 44 43 fwrite(buffer, sizeof(int), 4, fw); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Matrix4x4.cpp
r3103 r3279 401 401 402 402 403 // uniform scale 404 Matrix4x4 ScaleMatrix(float x) 405 { 406 Matrix4x4 M = IdentityMatrix(); 407 408 M.x[0][0] = x; 409 M.x[1][1] = x; 410 M.x[2][2] = x; 411 412 return M; 413 } 414 403 415 // Construct a rotation matrix that makes the x, y, z axes 404 416 // correspond to the vectors given. -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Matrix4x4.h
r3102 r3279 145 145 const Vector3 &vecTo); 146 146 Matrix4x4 ScaleMatrix(float X, float Y, float Z); 147 Matrix4x4 ScaleMatrix(float x); 147 148 Matrix4x4 GenRotation(const Vector3 &x, const Vector3 &y, 148 149 const Vector3 &z); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SkyPreetham.cpp
r3276 r3279 97 97 Camera *camera, 98 98 RenderState *state, 99 bool scaleToRange) 99 bool scaleToRange, 100 float skyDomeScaleFactor) 100 101 { 101 102 pair<float, float> sun_theta; … … 109 110 110 111 // scale the sky dome so no intersection with the scene is visible 111 //const float scaleFactor = 80.0f; 112 const float scaleFactor = 1000.0f; 113 114 position.z -= 3.0f * scaleFactor; 112 position.z -= 3.0f * skyDomeScaleFactor; 115 113 Matrix4x4 m = TranslationMatrix(position); 116 114 117 Matrix4x4 s = ScaleMatrix(s caleFactor, scaleFactor, scaleFactor);115 Matrix4x4 s = ScaleMatrix(skyDomeScaleFactor); 118 116 mSkyDome->GetTransform()->SetMatrix(s * m); 119 117 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SkyPreetham.h
r3085 r3279 26 26 CHCDemoEngine::Camera *camera, 27 27 CHCDemoEngine::RenderState *state, 28 bool scaleToRange); 28 bool scaleToRange, 29 float skyDomeScaleFactor); 29 30 30 31 void ComputeFactors(const CHCDemoEngine::Vector3 &sunDir, -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/VisibilitySolutionLoader.cpp
r3271 r3279 38 38 39 39 ViewCellsTree *viewCellsTree = new ViewCellsTree(); 40 41 40 bool ok = viewCellsTree->_LoadFromFile(fr, viewCellsScaleFactor); 42 41 … … 100 99 nodes.push_back(node); 101 100 102 if (!node->Is Leaf())101 if (!node->IsVirtualLeaf()) 103 102 { 104 103 BvhInterior *interior = static_cast<BvhInterior *>(node); … … 116 115 117 116 117 bool VisibilitySolutionLoader::CreateIdSortedList2(BvhNode *n, 118 BvhNodeContainer &nodes) 119 { 120 nodes.push_back(n); 121 122 if (!n->IsVirtualLeaf()) 123 { 124 BvhInterior *interior = static_cast<BvhInterior *>(n); 125 126 BvhNode *front = interior->GetFront(); 127 BvhNode *back = interior->GetBack(); 128 129 CreateIdSortedList2(front, nodes); 130 CreateIdSortedList2(back, nodes); 131 } 132 133 return true; 134 } 135 136 118 137 bool VisibilitySolutionLoader::LoadPvs(FILE *fw, Bvh *bvh) 119 138 { 120 139 int number, entries; 121 122 140 fread(&number, sizeof(int), 1, fw); 123 141 … … 135 153 136 154 BvhNodeContainer nodes; 137 CreateIdSortedList(bvh, nodes); 138 155 CreateIdSortedList2(bvh->GetStaticRoot(), nodes); 156 //CreateIdSortedList(bvh, nodes); 157 ofstream outstream("test.log"); 158 159 for (size_t i = 0; i < nodes.size(); ++ i) 160 outstream << "id " << nodes[i]->GetId() << endl; 161 162 outstream.close(); 163 164 139 165 for (int i = 0; i < number; ++ i) 140 166 { … … 194 220 AxisAlignedBox3 newBox1 = box; 195 221 AxisAlignedBox3 newBox2 = box; 196 /*if (node->mPosition < newBox.Min(node->mAxis)) 197 cout << "e: " << node->mPosition << " " << newBox.Min(node->mAxis) << endl; 198 else if (node->mPosition > newBox.Min(node->mAxis)) 199 cout << "o: " << node->mPosition << " " << newBox.Min(node->mAxis) << endl; 200 */ 222 201 223 newBox1.SetMin(node->mAxis, node->mPosition); 202 224 newBox2.SetMax(node->mAxis, node->mPosition); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/VisibilitySolutionLoader.h
r3257 r3279 11 11 struct ViewCell; 12 12 class Bvh; 13 class BvhNode; 13 14 14 15 typedef std::vector<ViewCell *> ViewCellsContainer; … … 32 33 bool CreateIdSortedList(Bvh *bvh, BvhNodeContainer &nodes); 33 34 35 bool CreateIdSortedList2(BvhNode *n, BvhNodeContainer &nodes); 36 37 34 38 bool LoadPvs(FILE *fw, Bvh *bvh); 35 39 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
r3277 r3279 106 106 const float fov = 50.0f; 107 107 108 float skyDomeScaleFactor = 80.0f; 109 108 110 SceneQuery *sceneQuery = NULL; 109 111 RenderQueue *renderQueue = NULL; … … 377 379 void RenderViewCell(); 378 380 379 void LoadPompeii Scene();381 void LoadPompeiiFloor(); 380 382 381 383 … … 471 473 env.GetBoolParam(string("useSkylightForIllum"), useSkylightForIllum); 472 474 env.GetFloatParam(string("viewCellsScaleFactor"), viewCellsScaleFactor); 473 475 env.GetFloatParam(string("skyDomeScaleFactor"), skyDomeScaleFactor); 476 474 477 //env.GetStringParam(string("modelPath"), model_path); 475 478 //env.GetIntParam(string("numSssaoSamples"), numSsaoSamples); … … 509 512 cout << "view cells scale factor: " << viewCellsScaleFactor << endl; 510 513 cout << "use skylight for illumination: " << useSkylightForIllum << endl; 514 cout << "sky dome scale factor: " << skyDomeScaleFactor << endl; 511 515 512 516 //cout << "model path: " << model_path << endl; … … 599 603 //LoadModel("sibenik.dem", dynamicObjects); 600 604 601 if ( 0) LoadPompeiiScene();605 if (1) LoadPompeiiFloor(); 602 606 603 607 #if 0 … … 2259 2263 2260 2264 if (!statsWriter) 2261 statsWriter = new StatsWriter(statsFilename );2265 statsWriter = new StatsWriter(statsFilename + ".log"); 2262 2266 2263 2267 FrameStats frameStats; … … 2406 2410 (renderMethod == RENDER_DEFERRED)) && useHDR; 2407 2411 2408 preetham->RenderSkyDome(-light->GetDirection(), camera, &renderState, !useToneMapping );2412 preetham->RenderSkyDome(-light->GetDirection(), camera, &renderState, !useToneMapping, skyDomeScaleFactor); 2409 2413 2410 2414 /// once again reset the renderState just to make sure … … 2695 2699 2696 2700 2697 void LoadPompeii Scene()2701 void LoadPompeiiFloor() 2698 2702 { 2699 2703 AxisAlignedBox3 pompeiiBox = SceneEntity::ComputeBoundingBox(staticObjects);
Note: See TracChangeset
for help on using the changeset viewer.