Changeset 2964 for GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
- Timestamp:
- 09/22/08 18:33:55 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
r2963 r2964 39 39 #include "ObjConverter.h" 40 40 #include "SkyPreetham.h" 41 #include "Texture.h" 41 42 42 43 … … 167 168 PerfTimer frameTimer, algTimer; 168 169 170 Texture *dirtTexture = NULL; 171 169 172 170 173 /// the used render type for this render pass … … 269 272 static CGparameter sMaxDepthParam; 270 273 static CGparameter sMaxDepthParamTex; 274 271 275 static Matrix4x4 oldViewProjMatrix; 272 276 … … 454 458 camera->SetFar(Magnitude(bvh->GetBox().Diagonal())); 455 459 460 dirtTexture = new Texture(model_path + "waterstain.jpg"); 461 //dirtTexture = new Texture(model_path + "dirt.jpg"); 462 dirtTexture->Create(); 463 456 464 InitCg(); 457 465 … … 470 478 471 479 //const string aeroplaneStr = model_path + "toyplane.dem"; 472 const string aeroplaneStr = model_path + "city_full.dem";480 //const string aeroplaneStr = model_path + "city_full.dem"; 473 481 474 482 SceneEntityContainer dummy; 475 483 476 if (loader->Load(aeroplaneStr, dummy)) 477 cout << "successfully loaded " << dummy.size() << " scene entities" << endl; 478 else 479 { 480 cerr << "loading file " << aeroplaneStr << " failed" << endl; 481 482 CleanUp(); 483 exit(0); 484 } 485 484 486 485 string skyDomeStr(model_path + "sky.dem"); 487 486 … … 496 495 } 497 496 498 aeroplane = dummy[0]; 499 skyDome = dummy[1]; 497 skyDome = dummy[0]; 498 499 500 /*if (loader->Load(aeroplaneStr, dummy)) 501 cout << "successfully loaded " << dummy.size() << " scene entities" << endl; 502 else 503 { 504 cerr << "loading file " << aeroplaneStr << " failed" << endl; 505 506 CleanUp(); 507 exit(0); 508 } 509 510 aeroplane = dummy[1]; 500 511 501 512 aeroplane->GetTransform()->MultMatrix(transl); 502 513 */ 503 514 const float turbitiy = 3.0f; 504 515 preetham = new SkyPreetham(turbitiy, skyDome); … … 569 580 570 581 sMaxDepthParamTex = cgGetNamedParameter(RenderState::sCgMrtFragmentTexProgram, "maxDepth"); 582 RenderState::sDirtTexParamTex = cgGetNamedParameter(RenderState::sCgMrtFragmentTexProgram, "dirtTex"); 583 RenderState::sTexParam = cgGetNamedParameter(RenderState::sCgMrtFragmentTexProgram, "tex"); 584 585 cgGLEnableTextureParameter(RenderState::sDirtTexParamTex); 586 cgGLSetTextureParameter(RenderState::sDirtTexParamTex, dirtTexture->GetId()); 571 587 572 588 cgGLSetParameter1f(sMaxDepthParamTex, MAX_DEPTH_CONST / farDist); … … 1086 1102 { 1087 1103 // actually render the scene geometry using the specified algorithm 1088 //traverser->RenderScene(); 1104 traverser->RenderScene(); 1105 /* 1089 1106 state.Reset(); 1090 /* SceneEntityContainer::const_iterator sit, sit_end = sceneEntities.end(); 1107 aeroplane->Render(&state); 1108 1109 SceneEntityContainer::const_iterator sit, sit_end = sceneEntities.end(); 1091 1110 1092 1111 for (sit = sceneEntities.begin(); sit != sit_end; ++ sit) 1093 1112 { 1094 1113 renderQueue->Enqueue(*sit); 1095 }*/ 1096 1097 aeroplane->Render(&state); 1114 } 1098 1115 1099 1116 renderQueue->Apply(); 1117 */ 1100 1118 } 1101 1119
Note: See TracChangeset
for help on using the changeset viewer.