Changeset 3295
- Timestamp:
- 02/06/09 17:34:25 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling
- Files:
-
- 3 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/Converter/ObjConverter.cpp
r3263 r3295 403 403 404 404 #if 0 405 405 406 bool ObjConverter::WriteFile(const string &filename) 406 407 { … … 480 481 return true; 481 482 } 483 482 484 #else 485 483 486 bool ObjConverter::WriteFile(const string &filename) 484 487 { … … 562 565 563 566 564 int entityCount = 1; 567 //int entityCount = 1; 568 int entityCount = mNumShapes; 565 569 ofile.write(reinterpret_cast<char *>(&entityCount), sizeof(int)); 566 570 567 571 568 572 ////////// 569 //-- write single scene entity 570 571 // no transformation 572 bool hasTrafo = false; 573 ofile.write(reinterpret_cast<char *>(&hasTrafo), sizeof(bool)); 574 575 // a dummy lod 576 int numLODs = 1; 577 ofile.write(reinterpret_cast<char *>(&numLODs), sizeof(int)); 578 579 float dist = 0; 580 ofile.write(reinterpret_cast<char *>(&dist), sizeof(float)); 581 582 ofile.write(reinterpret_cast<char *>(&mNumShapes), sizeof(int)); 573 //-- q: write single scene entity with all shapes or many entities with one shape 583 574 584 575 // all shapes belong to this scene entity 585 576 for (int i = 0; i < mNumShapes; ++ i) 586 577 { 578 // no transformation 579 bool hasTrafo = false; 580 ofile.write(reinterpret_cast<char *>(&hasTrafo), sizeof(bool)); 581 582 // a dummy lod 583 int numLODs = 1; 584 ofile.write(reinterpret_cast<char *>(&numLODs), sizeof(int)); 585 586 float dist = 0; 587 ofile.write(reinterpret_cast<char *>(&dist), sizeof(float)); 588 589 //ofile.write(reinterpret_cast<char *>(&mNumShapes), sizeof(int)); 590 int one = 1; 591 ofile.write(reinterpret_cast<char *>(&one), sizeof(int)); 592 587 593 int shapeId = i; 588 594 ofile.write(reinterpret_cast<char *>(&shapeId), sizeof(int)); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/Converter/main.cpp
r3275 r3295 1 #include "ObjConverter 2.h"1 #include "ObjConverter.h" 2 2 #include <iostream> 3 3 #include <time.h> … … 10 10 int returnCode = 0; 11 11 12 ObjConverter2 converter; 12 //ObjConverter2 converter; 13 ObjConverter converter; 13 14 14 15 cout << "converting obj to dem format" << endl; 15 #if 016 #if 1 16 17 if (!converter.LoadMaterials(model_path + argv[3])) 17 18 { -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/BvhConstructor.cpp
r3280 r3295 110 110 int bestAxis = 0; 111 111 112 // cout<<"Evaluating axis..."<<endl<<flush;113 114 112 const int initialPlanes = 3; 115 113 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SkyPreetham.cpp
r3291 r3295 294 294 // downscale ambient color 295 295 if (scaleToRange) 296 { 296 297 ambient *= 8e-6f; 298 } 297 299 else 298 300 { … … 342 344 // calculate final sun diffuse color. 343 345 if (scaleToRange) 346 { 344 347 diffuse = color * 3e-5f; 348 } 345 349 else 350 { 346 351 diffuse = color * 3e-1f; 352 } 347 353 348 354 // diffuse component should be more saturated (and less blueish) for high sun positions -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
r3294 r3295 160 160 int visibilitySolutionInitialState = 0; 161 161 162 Vector3 defaultAmbient(0.2f); 163 Vector3 defaultDiffuse(1.0f); 164 162 165 163 166 /// the technique used for rendering … … 462 465 env.GetVectorParam(string("camDirection"), camDir); 463 466 env.GetVectorParam(string("lightDirection"), lightDir); 467 env.GetVectorParam(string("defaultAmbient"), defaultAmbient); 468 env.GetVectorParam(string("defaultDiffuse"), defaultDiffuse); 464 469 465 470 env.GetBoolParam(string("useFullScreen"), useFullScreen); … … 617 622 //LoadModel("toyplane2.dem", dynamicObjects); 618 623 //LoadModel("elephal.dem", dynamicObjects); 619 //LoadModel("sibenik.dem", dynamicObjects);620 624 621 625 if (0) LoadPompeiiFloor(); … … 971 975 } 972 976 973 /** Setup sunlight977 /** Setup lighting conditions 974 978 */ 975 979 void SetupLighting() … … 1011 1015 else 1012 1016 { 1013 1014 ambient[0] = .2f; 1015 ambient[1] = .2f; 1016 ambient[2] = .2f; 1017 1018 diffuse[0] = 1.0f; 1019 diffuse[1] = 1.0f; 1020 diffuse[2] = 1.0f; 1017 ambient[0] = defaultAmbient.x; 1018 ambient[1] = defaultAmbient.y; 1019 ambient[2] = defaultAmbient.z; 1020 1021 diffuse[0] = defaultDiffuse.x; 1022 diffuse[1] = defaultDiffuse.y; 1023 diffuse[2] = defaultDiffuse.z; 1021 1024 } 1022 1025 … … 1296 1299 1297 1300 if (showShadowMap && !renderLightView) 1301 { 1298 1302 RenderShadowMap(camera->GetFar()); 1303 } 1299 1304 1300 1305 //glPushAttrib(GL_VIEWPORT_BIT); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaderenv.h
r3290 r3295 62 62 #define NUM_DOF_TABS 16 63 63 64 65 64 #define USE_GTX 66 65 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/globillum.cg
r3230 r3295 191 191 //-- compute color bleeding + ao 192 192 193 GiStruct gi = globIllum(IN, colors, noiseTex, samples, normal, eyeSpacePos, w, bl, br, tl, tr, normalize(IN.view), sampleIntensity); 193 GiStruct gi = globIllum(IN, colors, noiseTex, samples, normal, eyeSpacePos, 194 w, bl, br, tl, tr, normalize(IN.view), sampleIntensity); 194 195 195 196 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/toto.txt
r3280 r3295 196 196 197 197 find out ssao artifacts on edges (near edge no ambient occlusion) 198 199 200 /////////// 201 202 shadows not working proberly with chc!!! (too many triangles, slow!!) 203 204 sibenik: textures dissappear!!
Note: See TracChangeset
for help on using the changeset viewer.