ogre-next 3.0 point light not showing

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
User avatar
jordiperezarti
Kobold
Posts: 35
Joined: Sun Sep 01, 2024 7:50 pm

ogre-next 3.0 point light not showing

Post 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?

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5436
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1343

Re: ogre-next 3.0 point light not showing

Post by dark_sylinc »

User avatar
jordiperezarti
Kobold
Posts: 35
Joined: Sun Sep 01, 2024 7:50 pm

Re: ogre-next 3.0 point light not showing

Post 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.