Point light shadow cutt shape

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

Point light shadow cutt shape

Post by jordiperezarti »

In the render capture, i have one directional light that casts shadows correctly, and i have a point light that casts shadows.
In the point light shadow when not facing the center of the viewport, the shadow seems to be cutt.
I have tried to set lower the light shadow near clip distance, but no effect.

someone knows what is happening to see always the complete pointlight shadow shape?

User avatar
sercero
Bronze Sponsor
Bronze Sponsor
Posts: 544
Joined: Sun Jan 18, 2015 4:20 pm
Location: Buenos Aires, Argentina
x 200

Re: Point light shadow cutt shape

Post by sercero »

Are you using the RTSS?

User avatar
jordiperezarti
Halfling
Posts: 53
Joined: Sun Sep 01, 2024 7:50 pm

Re: Point light shadow cutt shape

Post by jordiperezarti »

Code: Select all

    RTShader::ShaderGenerator::getSingletonPtr()->addSceneManager(scnMgr);

scnMgr->setShadowTechnique(ShadowTechnique::SHADOWTYPE_TEXTURE_MODULATIVE);
scnMgr->setShadowFarDistance(2000);
scnMgr->setShadowCasterRenderBackFaces(false);
scnMgr->setShadowTextureSettings(1024, 2, Ogre::PF_BYTE_L, 8);

The material on the floor is this one:

Code: Select all

material MaterialFloor
{
    technique {
        pass {
            cull_hardware clockwise
            diffuse 0.9 0.9 0.9 1.0

        rtshader_system {
            lighting_stage normal_map floor_bump.png
        }

        texture_unit {
            texture floor_diffuse.png
        }
    }
}
}
User avatar
jordiperezarti
Halfling
Posts: 53
Joined: Sun Sep 01, 2024 7:50 pm

Re: Point light shadow cutt shape

Post by jordiperezarti »

It seems to help a bit this:

Code: Select all

scnMgr->setShadowUseLightClipPlanes(true);
pointLight->setShadowNearClipDistance(0.01);
pointLight->setShadowFarClipDistance(1000);

but the cutt shadow shape stills beeing there;
the problems seems to come from the shadow shape beeing linked to the camera matrix view direction.

User avatar
sercero
Bronze Sponsor
Bronze Sponsor
Posts: 544
Joined: Sun Jan 18, 2015 4:20 pm
Location: Buenos Aires, Argentina
x 200

Re: Point light shadow cutt shape

Post by sercero »

A video of the problem might help

User avatar
jordiperezarti
Halfling
Posts: 53
Joined: Sun Sep 01, 2024 7:50 pm

Re: Point light shadow cutt shape

Post by jordiperezarti »

[img]

rpgplayerrobin
Bugbear
Posts: 803
Joined: Wed Mar 18, 2009 3:03 am
x 462

Re: Point light shadow cutt shape

Post by rpgplayerrobin »

To me, this seems to not be normal lighting calculations?

  1. If RTSS Is creating the shaders, why is the ninja models not receiving shadows from the lights? Because they should.
  2. If RTSS is creating the shaders, why does it seem that the shadows are always at full strength (completely black almost)? It does not seem to be physically correct lighting here at all, and I would expect the two shadows when intersecting to be completely full strength instead of always full strength, since that makes no sense if there are two lights in the scene. Do you use PBR here? Otherwise, try PBR and see if that fixes most issues you are facing.
rpgplayerrobin
Bugbear
Posts: 803
Joined: Wed Mar 18, 2009 3:03 am
x 462

Re: Point light shadow cutt shape

Post by rpgplayerrobin »

I just looked again, and it seems you need to check how to setup your shadows with RTSS.
Check the code of one of the tutorials that use RTSS, because

Code: Select all

scnMgr->setShadowTextureSettings(1024, 2, Ogre::PF_BYTE_L, 8);

is incorrect and does not really use good shadows at all since PF_BYTE_L means that it is not even depth shadows (which is the one you most likely want).

Here is one example on how to set it up (source: https://ogrecave.github.io/ogre/api/lat ... _ogre.html), note that it uses PF_DEPTH16 since it is a better shadow setting that supports self shadowing and solves a lot of other problems that normal shadows has:

Code: Select all

// Use Ogre's custom shadow mapping ability
Ogre::SceneManager *mSceneMgr = ...;
Ogre::MaterialManager *materialMgr = Ogre::MaterialManager::getSingletonPtr();
mSceneMgr->setShadowTexturePixelFormat(PF_DEPTH16);
mSceneMgr->setShadowTechnique( SHADOWTYPE_TEXTURE_ADDITIVE );
mSceneMgr->setShadowTextureCasterMaterial(materialMgr->getByName("PSSM/shadow_caster"));
mSceneMgr->setShadowTextureReceiverMaterial(materialMgr->getByName("Ogre/DepthShadowmap/Receiver/RockWall"));
mSceneMgr->setShadowTextureSelfShadow(true);
mSceneMgr->setShadowTextureSize(1024);
User avatar
jordiperezarti
Halfling
Posts: 53
Joined: Sun Sep 01, 2024 7:50 pm

Re: Point light shadow cutt shape

Post by jordiperezarti »

the shadow pixel format using depth16 improves the shadow certainly.