有三種類型的光源,點光源,直射光,聚光燈。
點光源 LT_POINT
直射光 LT_DIRECTIONAL
聚光燈 LT_SPOTLIGHT
創建直射光, 直射光是從無窮遠距離直射過來,不需要設置位置,只需要方向。
Ogre::Light* directionalLight = mSceneMgr->createLight("directionalLight");
directionalLight->setDirection(Ogre::Vector3(0, -1, 1));
directionalLight->setType(Ogre::Light::LT_DIRECTIONAL);
directionalLight->setDiffuseColour(Ogre::ColourValue(.25, .25, 0));
directionalLight->setSpecularColour(Ogre::ColourValue(.25, .25, 0));
directionalLight->setDirection(Ogre::Vector3(0, -1, 1));