95 Ogre::Technique* tech = mat->getBestTechnique();
96 Ogre::Vector3 farCorner = camera->getViewMatrix(
true) * camera->getWorldSpaceCorners()[4];
99 Ogre::Pass* pass = tech->getPass(0);
100 Ogre::GpuProgramParametersSharedPtr params = pass->getVertexProgramParameters();
103 if (params->_findNamedConstantDefinition(
"farCorner"))
104 params->setNamedConstant(
"farCorner", farCorner);
106 params = pass->getFragmentProgramParameters();
107 if (params->_findNamedConstantDefinition(
"farCorner"))
108 params->setNamedConstant(
"farCorner", farCorner);
113 Ogre::Camera shadowCam(
"ShadowCameraSetupCam", 0);
114 shadowCam._notifyViewport(camera->getViewport());
118 sm->getShadowCameraSetup()->getShadowCamera(sm, camera, camera->getViewport(),
ogreParentLight, &shadowCam, 0);
123 if (params->_findNamedConstantDefinition(
"shadowCamPos"))
124 params->setNamedConstant(
"shadowCamPos", shadowCam.getPosition());
126 if (params->_findNamedConstantDefinition(
"shadowFarClip"))
127 params->setNamedConstant(
"shadowFarClip", shadowCam.getFarClipDistance());