-----------------------------------------------------------------------
| 218 | |
| 219 | //----------------------------------------------------------------------- |
| 220 | void Sample_ShaderSystem::setupContent() |
| 221 | { |
| 222 | mTextureAtlasFactory.reset(new TextureAtlasSamplerFactory); |
| 223 | mShaderGenerator->addSubRenderStateFactory(mTextureAtlasFactory.get()); |
| 224 | |
| 225 | mInstancedViewportsFactory.reset(new ShaderExInstancedViewportsFactory); |
| 226 | mShaderGenerator->addSubRenderStateFactory(mInstancedViewportsFactory.get()); |
| 227 | |
| 228 | // Setup default effects values. |
| 229 | mCurLightingModel = SSLM_PerPixelLighting; |
| 230 | mPerPixelFogEnable = false; |
| 231 | mSpecularEnable = false; |
| 232 | mReflectionMapSubRS = NULL; |
| 233 | mLayerBlendSubRS = NULL; |
| 234 | |
| 235 | mRayQuery = mSceneMgr->createRayQuery(Ray()); |
| 236 | mTargetObj = NULL; |
| 237 | |
| 238 | |
| 239 | // Set ambient lighting. |
| 240 | mSceneMgr->setAmbientLight(ColourValue(0.2, 0.2, 0.2)); |
| 241 | |
| 242 | // Setup the sky box, |
| 243 | mSceneMgr->setSkyBox(true, "Examples/SceneSkyBox2"); |
| 244 | |
| 245 | MeshManager::getSingleton().createPlane("Myplane", |
| 246 | ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Plane(Vector3::UNIT_Y, 0), |
| 247 | 1500,1500,25,25,true,1,60,60,Vector3::UNIT_Z); |
| 248 | |
| 249 | Entity* pPlaneEnt = mSceneMgr->createEntity( "plane", "Myplane" ); |
| 250 | pPlaneEnt->setMaterialName("Examples/Rockwall"); |
| 251 | pPlaneEnt->setCastShadows(false); |
| 252 | mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(0,0,0))->attachObject(pPlaneEnt); |
| 253 | |
| 254 | mCamera->setNearClipDistance(30); |
| 255 | |
| 256 | // Load sample meshes and generate tangent vectors. |
| 257 | for (const auto & curMeshName : MESH_ARRAY) |
| 258 | { |
| 259 | MeshPtr pMesh = MeshManager::getSingleton().load(curMeshName, |
| 260 | ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, |
| 261 | HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY, |
| 262 | HardwareBuffer::HBU_STATIC_WRITE_ONLY, |
| 263 | true, true); //so we can still read it |
| 264 | |
| 265 | // Build tangent vectors, all our meshes use only 1 texture coordset |
| 266 | pMesh->buildTangentVectors(); |
| 267 | } |
| 268 | |
| 269 | |
| 270 | |
| 271 | Entity* entity; |
| 272 | SceneNode* childNode; |
| 273 | |
| 274 | // Create the main entity and mark it as the current target object. |
| 275 | entity = mSceneMgr->createEntity(MAIN_ENTITY_NAME, MAIN_ENTITY_MESH); |
| 276 | mTargetEntities.push_back(entity); |
| 277 | childNode = mSceneMgr->getRootSceneNode()->createChildSceneNode(); |
nothing calls this directly
no test coverage detected