SO3Engine
|
SO3ShadowPSSM.cpp
Go to the documentation of this file.
22 const Ogre::RenderSystemCapabilities* caps = SRoot::getSingleton().GetOgreRenderSystem()->getCapabilities();
46SShadowPSSM::SShadowPSSM(SShadowManager* sManager) : SShadow(sManager, "PSSM", SShadowManager::SO3_SHADOWS_PSSM)
48 ogreScene->setShadowTechnique(static_cast <Ogre::ShadowTechnique> (Ogre::SHADOWDETAILTYPE_TEXTURE | Ogre::SHADOWDETAILTYPE_INTEGRATED | shadowManager->GetLightingTechnique()));
67 ogreScene->setShadowTextureConfig(0, (unsigned short)(quality * 1.5f), (unsigned short)(quality * 1.5f), mRttFormat);
70 ogreScene->setShadowTextureConfig(2, (unsigned short)(quality * 0.75f), (unsigned short)(quality * 0.75f), mRttFormat);
73 ogreScene->setShadowTextureConfig(0 + (i * cascadeCount) , (unsigned short)(quality * 1.5f), (unsigned short)(quality * 1.5f), mRttFormat);
77 ogreScene->setShadowTextureConfig(2 + (i * cascadeCount), (unsigned short)(quality * 0.75f), (unsigned short)(quality * 0.75f), mRttFormat);
87 Ogre::MaterialPtr mcaster = Ogre::MaterialManager::getSingleton().getByName("SO3/PSSM/ShadowCaster");
105 Ogre::PSSMShadowCameraSetup* pssmSetup = static_cast<StablePSSMShadowCameraSetup*>(shadowCameraSetup.get());
144 ogreScene->setShadowTechnique(static_cast <Ogre::ShadowTechnique> (Ogre::SHADOWDETAILTYPE_TEXTURE | Ogre::SHADOWDETAILTYPE_INTEGRATED | shadowManager->GetLightingTechnique()));
178 if (!tech || (tech->getParent()->getName() == "Ogre/Debug/LinesMat") /*|| ((tech->getSchemeName() != Ogre::MSN_SHADERGEN) &&
187 if (tech->hasColourWriteDisabled() || (!tech->getParent()->getReceiveShadows()) || (tech->getSchemeName() == "SO3/LIGHTSHAFT"))
237 //if (GetShadowManager()->GetLightingTechnique() == SShadowManager::SO3_ADDITIVE_SHADOWS_LIGHTING)
252 if (oPass && !oPass->getPolygonModeOverrideable() && (oPass->getPolygonMode() == Ogre::PM_POINTS))
261 nPass->setAlphaRejectSettings(oPass->getAlphaRejectFunction(), oPass->getAlphaRejectValue(), oPass->isAlphaToCoverageEnabled());
277 mcaster = Ogre::MaterialManager::getSingleton().getByName("SO3/PSSM/ShadowCaster")->clone("SO3/PSSM/ShadowCaster" + tech->getParent()->getName(), tech->getParent()->getGroup());
281 mcaster = Ogre::MaterialManager::getSingleton().getByName("SO3/PSSM/ShadowCaster" + tech->getParent()->getName());
288 mcaster = Ogre::MaterialManager::getSingleton().getByName("SO3/PSSM/ShadowCaster/Alpha")->clone("SO3/PSSM/ShadowCaster/Alpha" + tech->getParent()->getName(), tech->getParent()->getGroup());
292 mcaster = Ogre::MaterialManager::getSingleton().getByName("SO3/PSSM/ShadowCaster/Alpha" + tech->getParent()->getName());
320 const Ogre::PSSMShadowCameraSetup::SplitPointList& splitPointList = static_cast<Ogre::PSSMShadowCameraSetup*>(cameraSetup.get())->getSplitPoints();
329 //nPass->setFog(true, Ogre::FOG_LINEAR, Ogre::ColourValue::White, 0, shadowEnd * mFadeStart, shadowEnd * mFadeEnd);
336 sparams->setNamedConstant("fogParams", Ogre::Vector4(0.0f, dstart, dend, 1.0f / (dend - dstart)));
371 Ogre::MaterialPtr caster = Ogre::MaterialManager::getSingleton().getByName("SO3/PSSM/ShadowCaster");
372 if (caster && (caster->getNumTechniques() > 0) && (caster->getTechnique(0)->getNumPasses() > 0) && (caster->getTechnique(0)->getPass(0)->getNumTextureUnitStates() > 0))
412void StablePSSMShadowCameraSetup::getShadowCamera(const Ogre::SceneManager *sm, const Ogre::Camera *cam, const Ogre::Viewport *vp, const Ogre::Light *light, Ogre::Camera *texCam, size_t iteration) const
MMechostr(MSKDEBUG, " > Start loading Plugin SO3Engine dll\n")
bool GetRttPixelFormat(Ogre::PixelFormat &format, bool alpha=false, bool floattex=false)
Definition SO3Root.cpp:650
void RemoveGeneratedMaterial(Ogre::Material *mat)
Definition SO3Root.cpp:2343
const SMaterialMap * GetMaterials(const std::string &groupName)
Definition SO3Scene.cpp:1147
Definition SO3Shadow.h:70
void SetCameraSetup(Ogre::ShadowCameraSetupPtr shadowCameraSetup)
Definition SO3Shadow.cpp:57
Definition SO3ShadowManager.h:43
ShadowLightingType GetLightingTechnique()
Definition SO3ShadowManager.cpp:76
ShadowQuality GetShadowQuality()
Definition SO3ShadowManager.cpp:232
@ SO3_SHADOWS_QUALITY_HIGH
Definition SO3ShadowManager.h:63
virtual bool IsShadowMaterialPass(Ogre::Pass *pass)
Definition SO3ShadowPSSM.cpp:147
virtual void UpdateShadowTechnique()
Definition SO3ShadowPSSM.cpp:142
static bool CheckSystemCompatibility()
Definition SO3ShadowPSSM.cpp:15
virtual void UpdateShadowMaterial(Ogre::Technique *tech)
Definition SO3ShadowPSSM.cpp:176
virtual void RemoveMaterialPass(Ogre::Technique *tech)
Definition SO3ShadowPSSM.cpp:155
void getShadowCamera(const Ogre::SceneManager *sm, const Ogre::Camera *cam, const Ogre::Viewport *vp, const Ogre::Light *light, Ogre::Camera *texCam, size_t iteration) const override
Definition SO3ShadowPSSM.cpp:412
~StablePSSMShadowCameraSetup()
Definition SO3ShadowPSSM.cpp:408
static Ogre::ShadowCameraSetupPtr create()
Definition SO3ShadowPSSM.h:43
Definition SO3DataScol.h:38
std::unordered_map< std::string, SMaterial * > SMaterialMap
Definition SO3Prerequisites.h:269
std::unordered_map< std::string, SMaterialMap * > SGroupMaterialMap
Definition SO3Prerequisites.h:270
Generated by 1.9.8