Page 1 of 1

ogre-next 3.0 point light not showing

Posted: Sat Oct 26, 2024 6:00 pm
by jordiperezarti

I have one directional light that is working, but when i try adding one point light, the point light is not showing.
code:

Code: Select all

Light* directionalLight = this->sceneManager->createLight();
directionalLight->setType(Light::LT_DIRECTIONAL);
directionalLight->setDiffuseColour(ColourValue(0.4, 0.4, 0.4));
directionalLight->setSpecularColour(ColourValue(0.4, 0.1, 0.1));
directionalLight->setPowerScale(5);

SceneNode* directionalLightNode = this->sceneManager->getRootSceneNode()->createChildSceneNode();
directionalLightNode->attachObject(directionalLight);
directionalLightNode->setDirection(Vector3(1, -1, 0));


Light* pointLight = this->sceneManager->createLight();
pointLight->setType(Light::LT_POINT);
pointLight->setDiffuseColour(ColourValue(0.4, 0.4, 0.4));
pointLight->setSpecularColour(ColourValue(0.4, 0.1, 0.1));
pointLight->setPowerScale(500);

SceneNode* pointLightNode = this->sceneManager->getRootSceneNode()->createChildSceneNode();
pointLightNode->attachObject(pointLight);
pointLightNode->setPosition(0,200,0);

the floor is at position (0,0,0) but the point light is not affecting the render.
what could be happening?


Re: ogre-next 3.0 point light not showing

Posted: Tue Oct 29, 2024 3:21 pm
by dark_sylinc

Re: ogre-next 3.0 point light not showing

Posted: Sat Nov 02, 2024 10:45 pm
by jordiperezarti

This is running now!

I have used one preset from the sample source:

Code: Select all

sceneManager->setForward3D(true, 4, 4, 3, 128, 3.0f, 2000.0f);

then is needed the attenuation:

Code: Select all

pointLight->setAttenuationBasedOnRadius(300, 0.001);

this runs now.

If i add shadows:

Code: Select all

hlmsPbs->setShadowSettings( Ogre::HlmsPbs::PCF_2x2 );
pointLight->setCastShadows( true );

i don't see the shadows, what i am missing to setup?

thanks.