http://www.ogre3d.org/forums/viewtopic. ... ng#p355011
The shader is working OK, but I have a problem with the spot lights direction.
When I start rotating a spot light it immediately gets strange, like it jumps to some 90 degree angle.
I have created a spot light like this...
Code: Select all
Light* spotLight = sm->createLight("SpotLight");
spotLight->setDiffuseColour(1.0, 1.0, 1.0);
spotLight->setSpecularColour(1.0, 1.0, 1.0);
spotLight->setType(Ogre::Light::LT_SPOTLIGHT);
spotLight->setDirection(0, 0, -1);
spotLight->setAttenuation(5000, 1.0, 0.001, 0.0);
spotLight->setPowerScale( 1.0f );
spotLight->setSpotlightRange( Degree( 10 ), Degree( 70 ) );
SceneNode* SpotNew = sm->getRootSceneNode()->createChildSceneNode("spotNew");
SpotNew->attachObject( spotLight );
SpotNew->setPosition(Ogre::Vector3(20, 20, 20));
I rotate the spot light like this
Code: Select all
sm->getSceneNode( "spotNew" )->yaw( Radian( -0.001 ) );
Perhaps the problem is with the shader?