最近在研究ogre的shader,看了一下官网的教程,鼓捣了一下午总算是把效果搞出来,贴一下关键代码:
createSphere("sphere",10);
createSphere("Atomsphere",11);
Ogre::Entity* PlanetEntity = mSceneMgr->createEntity("planet","sphere");
PlanetEntity->setMaterialName("Examples/Rockwall");
Ogre::Entity* AtmosphereEntity = mSceneMgr->createEntity("planet_atm_Ent","Atomsphere");
//assign it our material
AtmosphereEntity->setMaterialName ("Atmosphere");
//also this will make the atmosphere to be rendered behind the planet
AtmosphereEntity->setRenderQueueGroup (Ogre::RENDER_QUEUE_BACKGROUND);
//here you will replace PlanetRadius and AtmosphereRadius with your values
AtmosphereEntity->getSubEntity (0)->setCu