Changeset 111 for trunk/VUT/work
- Timestamp:
- 05/24/05 17:55:14 (20 years ago)
- Location:
- trunk/VUT/work
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/work/TestCulling/TestCullingApplication.cpp
r107 r111 57 57 58 58 // Create a skybox 59 //mSceneMgr->setSkyBox(true, "Examples/CloudyNoonSkyBox", 2000, false);59 mSceneMgr->setSkyBox(true, "Examples/CloudyNoonSkyBox", 2000, true); 60 60 ColourValue fadeColour(0.1, 0.1, 0.6); 61 61 mWindow->getViewport(0)->setBackgroundColour(fadeColour); -
trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.cpp
r110 r111 52 52 //mCamera->setPosition(707, 5000, 528); 53 53 mCamNode->setOrientation(Quaternion(-0.3486, 0.0122, 0.9365, 0.0329)); 54 55 54 mCamNode->attachObject(mCamera); 56 55 … … 97 96 98 97 //-- create light 99 mSunLight = mSceneMgr->createLight("MainLight"); 100 mSunLight->setType(Light::LT_POINT); 101 mSunLight->setPosition(-707, 4000, -500); 98 mSunLight = mSceneMgr->createLight("SunLight"); 99 mSunLight->setType(Light::LT_DIRECTIONAL); 100 //mSunLight->setType(Light::LT_SPOTLIGHT); 101 mSunLight->setPosition(707, 2000, 500); 102 mSunLight->setCastShadows(true); 103 102 104 //mSunLight->setSpotlightRange(Degree(30), Degree(50)); 103 105 104 Vector3 dir; 105 dir = -mSunLight->getPosition(); 106 Vector3 dir(0.5, 0.1, 0.5); 106 107 dir.normalise(); 107 mSunLight->setDirection(dir); 108 mSunLight->setDiffuseColour(0.8, 0.8, 0.8); 109 mSunLight->setSpecularColour(0.9, 0.9, 1); 110 111 //mSunLight->setCastShadows(true); 108 mSunLight->setDirection(Vector3::NEGATIVE_UNIT_Y); 109 110 mSunLight->setDiffuseColour(1, 1, 1); 111 mSunLight->setSpecularColour(1, 1, 1); 112 112 113 113 // --Fog … … 130 130 setupGui(); 131 131 132 //mSceneMgr->setShadowTechnique(SHADOWTYPE_NONE); 133 134 // Floor plane 135 Plane plane; 136 plane.normal = Vector3::UNIT_Y; 137 plane.d = -60; 138 MeshManager::getSingleton().createPlane("Myplane", 139 ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, plane, 140 5000,5000,100,100,true,1,5,5,Vector3::UNIT_Z); 141 Entity* pPlaneEnt = mSceneMgr->createEntity( "plane", "Myplane" ); 142 pPlaneEnt->setMaterialName("Examples/Rockwall"); 143 pPlaneEnt->setCastShadows(true); 144 mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(pPlaneEnt); 145 146 if (mRoot->getRenderSystem()->getCapabilities()->hasCapability(RSC_HWRENDER_TO_TEXTURE)) 147 { 148 // In D3D, use a 1024x1024 shadow texture 149 mSceneMgr->setShadowTextureSettings(1024, 2); 150 } 151 else 152 { 153 // Use 512x512 texture in GL since we can't go higher than the window res 154 mSceneMgr->setShadowTextureSettings(512, 2); 155 } 156 mSceneMgr->setShadowColour(ColourValue(0, 0, 0)); 157 // mSceneMgr->setShowDebugShadows(true); 158 159 132 160 //-- terrain content setup 133 161 … … 144 172 // => there is much occlusion 145 173 mTerrainContentGenerator->SetMaxPos(Vector3(3000.0f, 50.0f, 3000.0f)); 146 mTerrainContentGenerator->SetOffset( 50);174 mTerrainContentGenerator->SetOffset(0); 147 175 148 176 // the objects are generated on the whole terrain 149 177 mTerrainContentGenerator->GenerateScene(1500, "athene"); 178 //mTerrainContentGenerator->GenerateScene(1500, "robot"); 150 179 // mTerrainContentGenerator->GenerateScene(500, "ninja"); 151 180 } … … 215 244 mCurrentFrame(0), 216 245 mRecord(false), 217 mTimeElapsed(0) 246 mTimeElapsed(0), 247 mUseShadows(false) 218 248 { 219 249 // Reduce move speed … … 292 322 // Get results, create a node/entity on the position 293 323 mCurrentObject = mTerrainContentGenerator->GenerateSceneObject( 294 mouseRay.getOrigin(), Vector3(0,0,0), "robot .mesh");324 mouseRay.getOrigin(), Vector3(0,0,0), "robot"); 295 325 296 326 mLMouseDown = true; … … 434 464 KEY_PRESSED(KC_F2, 0.3, toggleRecord()); 435 465 KEY_PRESSED(KC_F3, 0.3, mTerrainContentGenerator->WriteObjects(objects_outfile)); 466 KEY_PRESSED(KC_F4, 0.3, toggleUseShadows()); 436 467 //KEY_PRESSED(KC_F3, 0.3, writeFrames()); 437 468 //KEY_PRESSED(KC_F4, 0.3, loadFrames()); … … 706 737 } 707 738 //----------------------------------------------------------------------- 739 void MouseQueryListener::toggleUseShadows() 740 { 741 mUseShadows = !mUseShadows; 742 743 //mSunLight->setCastShadows(mUseShadows); 744 745 if (mUseShadows) 746 { 747 mSceneMgr->setShadowTechnique(SHADOWTYPE_TEXTURE_MODULATIVE); 748 } 749 else 750 { 751 mSceneMgr->setShadowTechnique(SHADOWTYPE_NONE); 752 } 753 754 } 755 //----------------------------------------------------------------------- 708 756 void MouseQueryListener::toggleRenderNodesForViz() 709 757 { -
trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.h
r109 r111 113 113 void loadFrames(); 114 114 115 void toggleUseShadows(); 116 115 117 protected: 116 118 void Clamp2Terrain(); … … 162 164 bool mRecord; 163 165 Real mTimeElapsed; 166 bool mUseShadows; 164 167 }; 165 168
Note: See TracChangeset
for help on using the changeset viewer.