mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-25 06:35:30 +00:00
Enable shadow casting for terrain
Add a check to TerrainDrawable to make sure shadows are only drawn once, not once per blending pass
This commit is contained in:
parent
8141ee47d5
commit
ceaf0ee409
@ -206,7 +206,7 @@ namespace MWRender
|
||||
|
||||
osgShadow::ShadowSettings* settings = shadowedScene->getShadowSettings();
|
||||
settings->setLightNum(0);
|
||||
settings->setCastsShadowTraversalMask(Mask_Scene|Mask_Actor|Mask_Player);
|
||||
settings->setCastsShadowTraversalMask(Mask_Scene|Mask_Actor|Mask_Player|Mask_Terrain);
|
||||
settings->setReceivesShadowTraversalMask(~0u);
|
||||
|
||||
//settings->setShadowMapProjectionHint(osgShadow::ShadowSettings::PERSPECTIVE_SHADOW_MAP);
|
||||
|
@ -51,6 +51,12 @@ void TerrainDrawable::cull(osgUtil::CullVisitor *cv)
|
||||
if (osg::isNaN(depth))
|
||||
return;
|
||||
|
||||
if (cv->getCurrentCamera()->getName() == "ShadowCamera")
|
||||
{
|
||||
cv->addDrawableAndDepth(this, &matrix, depth);
|
||||
return;
|
||||
}
|
||||
|
||||
bool pushedLight = mLightListCallback && mLightListCallback->pushLightState(this, cv);
|
||||
|
||||
for (PassVector::const_iterator it = mPasses.begin(); it != mPasses.end(); ++it)
|
||||
|
Loading…
x
Reference in New Issue
Block a user