more shadow matrixes?

Discussion area about developing or extending OGRE, adding plugins for it or building applications on it. No newbie questions please, use the Help forum for that.
Post Reply
User avatar
sparkprime
Ogre Magi
Posts: 1137
Joined: Mon May 07, 2007 3:43 am
Location: Ossining, New York
Contact:

more shadow matrixes?

Post by sparkprime » Sat Sep 19, 2009 8:23 am

Is it possible to have a full breakdown of the shadow matrixes as autoparams? I'd like worldview and proj in order to do my variable penumbra stuff. Anyone who wants just 'world' can use the standard 'world' I assume. Currently only worldviewproj and viewproj are supported as far as I can see.

If this is easy to add then I could potentially do it, although I don't really know what the following code actually does:

Code: Select all

                if (mCameraRelativeRendering)
                {
                    // World positions are now going to be relative to the camera position
                    // so we need to alter the projector view matrix to compensate
                    Matrix4 viewMatrix;
                    mCurrentTextureProjector[index]->calcViewMatrixRelative(
                        mCurrentCamera->getDerivedPosition(), viewMatrix);
                    mTextureViewProjMatrix[index] =
                        PROJECTIONCLIPSPACE2DTOIMAGESPACE_PERSPECTIVE *
                        mCurrentTextureProjector[index]->getProjectionMatrixWithRSDepth() *
                        viewMatrix;
                }
                else
                {
                    mTextureViewProjMatrix[index] =
                        PROJECTIONCLIPSPACE2DTOIMAGESPACE_PERSPECTIVE *
                        mCurrentTextureProjector[index]->getProjectionMatrixWithRSDepth() *
                        mCurrentTextureProjector[index]->getViewMatrix();
                }
A related question: for lispsm, is the view matrix just a standard translate + rotate into camera space or is it more exciting. In other words, is the excitement limited to the projection matrix or is there also some excitement in the view matrix.

thanks
0 x

User avatar
sparkprime
Ogre Magi
Posts: 1137
Joined: Mon May 07, 2007 3:43 am
Location: Ossining, New York
Contact:

Re: more shadow matrixes?

Post by sparkprime » Sat Sep 19, 2009 9:16 am

Just to give some context, I'm trying to make sure the penumbra is always 10cm. But because I'm using a directional light with LiSPSM, as I get further from the object, the penumbra grows in an unpleasant way. So I'm trying to push things through the shadow matrix in order to find out by what amount to scale my PCF taps. At the moment I'm scaling it by a given factor but this is in the texture space, not world space as I need it.
0 x

User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19265
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 2
Contact:

Re: more shadow matrixes?

Post by sinbad » Sun Sep 20, 2009 3:56 pm

The view matrix is generally fairly uninteresting except that it's adjusted for the focal region - the unusual stuff is in the projection matrix. However the code there is dealing with camera-relative rendering where the view matrix doesn't contain any translation, just rotation. You can just split apart the concatenation in that code above if you needed the view & projection matrices separately.
0 x

Post Reply