1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 09:23:53 +00:00

Merge branch 'osgshadow-test-vdsm-sky-method-two' into osgshadow-test-vdsm

This commit is contained in:
AnyOldName3 2017-11-08 00:35:54 +00:00
commit c3616ca78b
3 changed files with 7 additions and 2 deletions

View file

@ -210,7 +210,7 @@ namespace MWRender
settings->setReceivesShadowTraversalMask(~0u);
//settings->setShadowMapProjectionHint(osgShadow::ShadowSettings::PERSPECTIVE_SHADOW_MAP);
settings->setBaseShadowTextureUnit(8 - MWShadow::numberOfShadowMapsPerLight);
settings->setBaseShadowTextureUnit(MWShadow::baseShadowTextureUnit);
//settings->setMinimumShadowMapNearFarRatio(0);
settings->setNumShadowMapsPerLight(MWShadow::numberOfShadowMapsPerLight);
//settings->setShadowMapProjectionHint(osgShadow::ShadowSettings::ORTHOGRAPHIC_SHADOW_MAP);

View file

@ -13,6 +13,8 @@ namespace MWRender
MWShadow();
const static int baseShadowTextureUnit = 8 - numberOfShadowMapsPerLight;
virtual void cull(osgUtil::CullVisitor& cv);
protected:
const int debugTextureUnit;

View file

@ -48,6 +48,7 @@
#include "vismask.hpp"
#include "renderbin.hpp"
#include "shadow.hpp"
namespace
{
@ -1122,7 +1123,9 @@ SkyManager::SkyManager(osg::Group* parentNode, Resource::SceneManager* sceneMana
skyroot->setName("Sky Root");
// Assign empty program to specify we don't want shaders
// The shaders generated by the SceneManager can't handle everything we need
skyroot->getOrCreateStateSet()->setAttributeAndModes(new osg::Program(), osg::StateAttribute::OVERRIDE);
skyroot->getOrCreateStateSet()->setAttributeAndModes(new osg::Program(), osg::StateAttribute::OVERRIDE|osg::StateAttribute::PROTECTED|osg::StateAttribute::ON);
for (int i = MWShadow::baseShadowTextureUnit; i < MWShadow::baseShadowTextureUnit + MWShadow::numberOfShadowMapsPerLight; ++i)
skyroot->getOrCreateStateSet()->setTextureMode(i, GL_TEXTURE_2D, osg::StateAttribute::PROTECTED | osg::StateAttribute::OFF);
skyroot->setNodeMask(Mask_Sky);
parentNode->addChild(skyroot);