Changeset 2272 for GTP/trunk/App/Demos/Illum/Ogre/src
- Timestamp:
- 03/20/07 19:10:57 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Illum/Ogre/src/ReflectionTest/include/ReflectionTest.h
r2175 r2272 39 39 bool useCauInt = true; 40 40 41 int currentMaterial = 1;41 int currentMaterial = 0; 42 42 int currentObject = 1; 43 43 String objectNames[] = {String("sphere.mesh"), … … 46 46 String("head.mesh")}; 47 47 48 float objectscales[] = {0.01,1 ,1,0.1};48 float objectscales[] = {0.01,1.7,1,0.1}; 49 49 float scenescales[] = {0.3,1, 2.7}; 50 50 … … 108 108 bool processUnbufferedKeyInput(const FrameEvent& evt) 109 109 { 110 if (mInputDevice->isKeyDown(KC_F2) && mTimeUntilNextToggle <= 0) 111 { 112 TexturePtr tex = TextureManager::getSingleton().getByName("SCREENSHOT"); 113 tex->getBuffer()->getRenderTarget()->update(); 114 tex->getBuffer()->getRenderTarget()->writeContentsToFile(String("screen") + StringConverter::toString(framecount) + ".tga"); 115 mTimeUntilNextToggle = 0.5; 116 } 117 110 118 static float lastTime = 0.0; 111 119 float thisTime = (float) Root::getSingleton().getTimer()->getMilliseconds() / 1000.0f; … … 367 375 368 376 SceneNode* objectNode; 377 Texture* screenTexture; 369 378 370 379 void createCamera(void) … … 423 432 void createScene(void) 424 433 { 425 createPostproc();434 //createPostproc(); 426 435 427 436 OgreIlluminationManager::getSingleton().setMainCamera(mCamera); … … 432 441 Root::getSingleton()._setCurrentSceneManager(mSceneMgr); 433 442 434 mCamera->setFOVy(Radian(Degree( 80 * mWindow->getHeight() / mWindow->getWidth())));443 mCamera->setFOVy(Radian(Degree(90 * mWindow->getHeight() / mWindow->getWidth()))); 435 444 mCamera->setFarClipDistance(200); 436 445 mCamera->setNearClipDistance(0.1); … … 439 448 440 449 OgreIlluminationManager::getSingleton().setFocusingSM(false); 441 OgreIlluminationManager::getSingleton().setShadowMapSize( 512);450 OgreIlluminationManager::getSingleton().setShadowMapSize(700); 442 451 OgreIlluminationManager::getSingleton().setBlurShadowMap(true); 443 OgreIlluminationManager::getSingleton().setShadowMapMaterialName("G ameTools/ShadowMapDistance");452 OgreIlluminationManager::getSingleton().setShadowMapMaterialName("GTP/Basic/Distance_Normalized"); 444 453 mSceneMgr->setAmbientLight(ColourValue(0.505 * 0.2, 0.897 * 0.2, 0.914 * 0.2)); 445 454 … … 449 458 if(scene == 3) createScene3(); 450 459 460 TexturePtr texPtr = Ogre::TextureManager::getSingleton().createManual( "SCREENSHOT", 461 "default", 462 TEX_TYPE_2D, 463 1600, 464 1200, 465 0, 466 0, 467 PF_R8G8B8, 468 TU_RENDERTARGET); 469 screenTexture = texPtr.getPointer(); 470 RenderTexture* rt = screenTexture->getBuffer()->getRenderTarget(); 471 Viewport* vp = rt->addViewport(mCamera); 472 rt->setAutoUpdated(false); 473 vp->setOverlaysEnabled(false); 474 475 451 476 OgreIlluminationManager::getSingleton().initTechniques(); 452 477 } … … 455 480 SceneNode* rootNode = mSceneMgr->getRootSceneNode(); 456 481 457 mCamera->getParentSceneNode()->translate( 1.1,0.8,1.0);458 //mCamera->lookAt(Vector3(0,1.2,0.0));482 mCamera->getParentSceneNode()->translate(0.944, 1.857, 1.054); 483 mCamera->lookAt(Vector3(0.11, 1.043, -0.102)); 459 484 460 485 object = mSceneMgr->createEntity("object", objectNames[currentObject]); … … 467 492 objectNode->scale(scale, scale, scale); 468 493 469 objectNode->setPosition(0 ,1.2,0);494 objectNode->setPosition(0.136, 1.032, 0.031); 470 495 objectNode->_updateBounds(); 471 496
Note: See TracChangeset
for help on using the changeset viewer.