[2.1] Point/Spotlight not lighting
Posted: Mon Dec 03, 2018 3:34 pm
Hello!
I can't seem to figure out how to use point- and spotlights. Directional works fine with zero issues.
As far as I can tell the difference should not be that big? Other than needing a position (instead of direction for point, and both for spot).
So to be clear: I have a single light in my scene, i set the type to LT_POINT (for example) and everything is black as if there was no light at all.
Here is an example of trying to set up a point light, inspired by the sample InstantRadiosty:
Is there something I need other than the light?
As mentioned earlier I have tried to look through the samples but I can't figure out whats different.
I feel like I've missed something really simple, but for now I really can't see why it doesn't work. Any help would be appreciated!
I can't seem to figure out how to use point- and spotlights. Directional works fine with zero issues.
As far as I can tell the difference should not be that big? Other than needing a position (instead of direction for point, and both for spot).
So to be clear: I have a single light in my scene, i set the type to LT_POINT (for example) and everything is black as if there was no light at all.
Here is an example of trying to set up a point light, inspired by the sample InstantRadiosty:
Code: Select all
{
...
// Create Light
Ogre::Light* light = sm->createLight();
Ogre::SceneNode* sunNode = sm->getRootSceneNode()->createChildSceneNode();
sunNode->attachObject(light);
sunNode->setDirection(Ogre::Vector3(1, 0.0f, 0.0f)); // For when it isnt a point light
sunNode->translate(5, 0, 0);
light->setType(Ogre::Light::LT_POINT);
light->setPowerScale(Ogre::Math::PI / 2);
light->setAttenuation(32.0f, 1.0f, 0.14f, 0.07f);
...
}
As mentioned earlier I have tried to look through the samples but I can't figure out whats different.
I feel like I've missed something really simple, but for now I really can't see why it doesn't work. Any help would be appreciated!