mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 13:23:53 +00:00
Merge branch 'osgshadow-test-vdsm-sky-method-two' into osgshadow-test-vdsm
This commit is contained in:
commit
c3616ca78b
3 changed files with 7 additions and 2 deletions
|
@ -210,7 +210,7 @@ namespace MWRender
|
||||||
settings->setReceivesShadowTraversalMask(~0u);
|
settings->setReceivesShadowTraversalMask(~0u);
|
||||||
|
|
||||||
//settings->setShadowMapProjectionHint(osgShadow::ShadowSettings::PERSPECTIVE_SHADOW_MAP);
|
//settings->setShadowMapProjectionHint(osgShadow::ShadowSettings::PERSPECTIVE_SHADOW_MAP);
|
||||||
settings->setBaseShadowTextureUnit(8 - MWShadow::numberOfShadowMapsPerLight);
|
settings->setBaseShadowTextureUnit(MWShadow::baseShadowTextureUnit);
|
||||||
//settings->setMinimumShadowMapNearFarRatio(0);
|
//settings->setMinimumShadowMapNearFarRatio(0);
|
||||||
settings->setNumShadowMapsPerLight(MWShadow::numberOfShadowMapsPerLight);
|
settings->setNumShadowMapsPerLight(MWShadow::numberOfShadowMapsPerLight);
|
||||||
//settings->setShadowMapProjectionHint(osgShadow::ShadowSettings::ORTHOGRAPHIC_SHADOW_MAP);
|
//settings->setShadowMapProjectionHint(osgShadow::ShadowSettings::ORTHOGRAPHIC_SHADOW_MAP);
|
||||||
|
|
|
@ -13,6 +13,8 @@ namespace MWRender
|
||||||
|
|
||||||
MWShadow();
|
MWShadow();
|
||||||
|
|
||||||
|
const static int baseShadowTextureUnit = 8 - numberOfShadowMapsPerLight;
|
||||||
|
|
||||||
virtual void cull(osgUtil::CullVisitor& cv);
|
virtual void cull(osgUtil::CullVisitor& cv);
|
||||||
protected:
|
protected:
|
||||||
const int debugTextureUnit;
|
const int debugTextureUnit;
|
||||||
|
|
|
@ -48,6 +48,7 @@
|
||||||
|
|
||||||
#include "vismask.hpp"
|
#include "vismask.hpp"
|
||||||
#include "renderbin.hpp"
|
#include "renderbin.hpp"
|
||||||
|
#include "shadow.hpp"
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
|
@ -1122,7 +1123,9 @@ SkyManager::SkyManager(osg::Group* parentNode, Resource::SceneManager* sceneMana
|
||||||
skyroot->setName("Sky Root");
|
skyroot->setName("Sky Root");
|
||||||
// Assign empty program to specify we don't want shaders
|
// Assign empty program to specify we don't want shaders
|
||||||
// The shaders generated by the SceneManager can't handle everything we need
|
// 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);
|
skyroot->setNodeMask(Mask_Sky);
|
||||||
parentNode->addChild(skyroot);
|
parentNode->addChild(skyroot);
|
||||||
|
|
Loading…
Reference in a new issue