mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-01 01:45:34 +00:00
Switch to a tidier way of disabling the correct texture unit
This commit is contained in:
parent
26fe47b9a2
commit
7a03ad6558
3 changed files with 5 additions and 2 deletions
|
@ -210,7 +210,7 @@ namespace MWRender
|
|||
settings->setReceivesShadowTraversalMask(~0u);
|
||||
|
||||
//settings->setShadowMapProjectionHint(osgShadow::ShadowSettings::PERSPECTIVE_SHADOW_MAP);
|
||||
settings->setBaseShadowTextureUnit(7);
|
||||
settings->setBaseShadowTextureUnit(MWShadow::baseShadowTextureUnit);
|
||||
//settings->setMinimumShadowMapNearFarRatio(0);
|
||||
//settings->setNumShadowMapsPerLight(1);
|
||||
//settings->setShadowMapProjectionHint(osgShadow::ShadowSettings::ORTHOGRAPHIC_SHADOW_MAP);
|
||||
|
|
|
@ -10,6 +10,8 @@ namespace MWRender
|
|||
public:
|
||||
MWShadow();
|
||||
|
||||
const static int baseShadowTextureUnit = 7;
|
||||
|
||||
virtual void cull(osgUtil::CullVisitor& cv);
|
||||
protected:
|
||||
const int debugTextureUnit;
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
|
||||
#include "vismask.hpp"
|
||||
#include "renderbin.hpp"
|
||||
#include "shadow.hpp"
|
||||
|
||||
namespace
|
||||
{
|
||||
|
@ -1123,7 +1124,7 @@ SkyManager::SkyManager(osg::Group* parentNode, Resource::SceneManager* sceneMana
|
|||
// 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|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);
|
||||
parentNode->addChild(skyroot);
|
||||
|
|
Loading…
Reference in a new issue