mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-09 21:44:54 +00:00
Switch to a tidier way of disabling the correct texture unit
This commit is contained in:
parent
26fe47b9a2
commit
7a03ad6558
@ -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(7);
|
settings->setBaseShadowTextureUnit(MWShadow::baseShadowTextureUnit);
|
||||||
//settings->setMinimumShadowMapNearFarRatio(0);
|
//settings->setMinimumShadowMapNearFarRatio(0);
|
||||||
//settings->setNumShadowMapsPerLight(1);
|
//settings->setNumShadowMapsPerLight(1);
|
||||||
//settings->setShadowMapProjectionHint(osgShadow::ShadowSettings::ORTHOGRAPHIC_SHADOW_MAP);
|
//settings->setShadowMapProjectionHint(osgShadow::ShadowSettings::ORTHOGRAPHIC_SHADOW_MAP);
|
||||||
|
@ -10,6 +10,8 @@ namespace MWRender
|
|||||||
public:
|
public:
|
||||||
MWShadow();
|
MWShadow();
|
||||||
|
|
||||||
|
const static int baseShadowTextureUnit = 7;
|
||||||
|
|
||||||
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
|
||||||
{
|
{
|
||||||
@ -1123,7 +1124,7 @@ SkyManager::SkyManager(osg::Group* parentNode, Resource::SceneManager* sceneMana
|
|||||||
// 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|osg::StateAttribute::PROTECTED|osg::StateAttribute::ON);
|
skyroot->getOrCreateStateSet()->setAttributeAndModes(new osg::Program(), osg::StateAttribute::OVERRIDE|osg::StateAttribute::PROTECTED|osg::StateAttribute::ON);
|
||||||
skyroot->getOrCreateStateSet()->setTextureMode(1, GL_TEXTURE_2D, osg::StateAttribute::PROTECTED | osg::StateAttribute::OFF);
|
skyroot->getOrCreateStateSet()->setTextureMode(MWShadow::baseShadowTextureUnit, GL_TEXTURE_2D, osg::StateAttribute::PROTECTED | osg::StateAttribute::OFF);
|
||||||
|
|
||||||
skyroot->setNodeMask(Mask_Sky);
|
skyroot->setNodeMask(Mask_Sky);
|
||||||
parentNode->addChild(skyroot);
|
parentNode->addChild(skyroot);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user