[SOLVED] LiSPSMShadow not working on 1.13

Problems building or running the engine, queries about how to use features etc.
Post Reply
User avatar
suny
Greenskin
Posts: 137
Joined: Thu Mar 12, 2020 5:53 pm
x 60

[SOLVED] LiSPSMShadow not working on 1.13

Post by suny »

Ogre Version: 1.13
Operating System: windows
Render System: dx9

First of all, sorry for me spamming the forum: I have a lot of issues porting my code from 1.12 to 1.13...
My shadows are using LiSPSM, and it has been working for some years. With 1.13, I have black shadows everywhere.

I was doing this to init the shadows :

Code: Select all

camSetup = OGRE_NEW Ogre::LiSPSMShadowCameraSetup;
camSetup->setCameraLightDirectionThreshold(Ogre::Degree(5));
camSetup->setUseAggressiveFocusRegion(true);
camSetup->setOptimalAdjustFactor((Ogre::Real) 200);
mSceneMgr->setShadowFarDistance(270); //200 - bigger for 45 degrees
mSceneMgr->setShadowCameraSetup(Ogre::ShadowCameraSetupPtr(camSetup));

mSceneMgr->setShadowTechnique(Ogre::SHADOWTYPE_TEXTURE_MODULATIVE_INTEGRATED);
mSceneMgr->addListener(&shadowCameraUpdaterPlay);
I tried to replace all the options by

Code: Select all

camSetup = OGRE_NEW Ogre::LiSPSMShadowCameraSetup;
camSetup->create(200, true, Ogre::Degree(5));
But with no difference. I also tried the default values.

Then my listener:

Code: Select all

struct shadowListener: public Ogre::SceneManager::Listener
{
    // this is a callback we'll be using to set up our shadow camera
    void shadowTextureCasterPreViewProj(Ogre::Light *light, Ogre::Camera *cam, size_t)
    {
        float range = light->getAttenuationRange();
        cam->setNearClipDistance(0.01);
        cam->setFarClipDistance(range);
    }
    void shadowTexturesUpdated(size_t) {}
    void shadowTextureReceiverPreViewProj(Ogre::Light*, Ogre::Frustum*) {}
    void preFindVisibleObjects(Ogre::SceneManager*, Ogre::SceneManager::IlluminationRenderStage, Ogre::Viewport*) {}
    void postFindVisibleObjects(Ogre::SceneManager*, Ogre::SceneManager::IlluminationRenderStage, Ogre::Viewport*) {}
} shadowCameraUpdaterPlay;
S.
Last edited by suny on Wed Sep 22, 2021 2:51 pm, edited 1 time in total.
paroj
OGRE Team Member
OGRE Team Member
Posts: 1994
Joined: Sun Mar 30, 2014 2:51 pm
x 1074
Contact:

Re: LiSPSMShadow not working on 1.13

Post by paroj »

User avatar
suny
Greenskin
Posts: 137
Joined: Thu Mar 12, 2020 5:53 pm
x 60

Re: LiSPSMShadow not working on 1.13

Post by suny »

Oh, I completely missed that...
Thanks a lot!
S.
Post Reply