ogre阴影

开启阴影技术:mSceneMgr->setShadowTechnique(SHADOWTYPE_STENCIL_ADDITIVE);

某个实体开启和关闭阴影:ent->setCastShadows(false);

创建灯光:每个灯光产生一个阴影

Light* light = mSceneMgr->createLight("Light1");
light->setType(Light::LT_POINT);
light->setPosition(Vector3(0.0f, 150.0f, 250.0f));
light->setDiffuseColour(ColourValue(1.0f, 0.0f, 0.0f));
light->setSpecularColour(ColourValue(1.0f, 0.0f, 0.0f));

创建多个视口:Viewport* vp = mWindow->addViewport(mCamera, 1, 0.0f, 0.0f, 0.5f, 1.0f);
Viewport* vp2 = mWindow->addViewport(mCamera, 2, 0.5f, 0.0f, 0.5f, 1.0f);

创建平面地面:Plane plane(Vector3::UNIT_Y, 0.0f);
MeshManager::getSingleton().createPlane("ground",
ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, plane,
 1500.0f, 1500.0f, 20, 20, true, 1.0f, 5.0f, 5.0f, Vector3::UNIT_Z);
ent = mSceneMgr->createEntity("GroundEntity", "ground");
mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(ent);
ent->setMaterialName("Examples/Rockwall");

posted on 2012-04-30 22:28  紫澜  阅读(734)  评论(0编辑  收藏  举报