mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-28 14:53:58 +00:00
Merge pull request #2346 from Capostrophic/shaders
Make sure forcePPL and clamp are defined in the editor
This commit is contained in:
commit
0bec84342c
@ -11,6 +11,8 @@
|
||||
#include <components/esm/cellref.hpp>
|
||||
|
||||
#include <components/resource/scenemanager.hpp>
|
||||
#include <components/sceneutil/shadow.hpp>
|
||||
#include <components/shader/shadermanager.hpp>
|
||||
#include <components/vfs/manager.hpp>
|
||||
#include <components/vfs/registerarchives.hpp>
|
||||
|
||||
@ -75,6 +77,14 @@ CSMWorld::Data::Data (ToUTF8::FromType encoding, bool fsStrict, const Files::Pat
|
||||
mResourcesManager.setVFS(mVFS.get());
|
||||
mResourceSystem.reset(new Resource::ResourceSystem(mVFS.get()));
|
||||
|
||||
Shader::ShaderManager::DefineMap defines = mResourceSystem->getSceneManager()->getShaderManager().getGlobalDefines();
|
||||
Shader::ShaderManager::DefineMap shadowDefines = SceneUtil::ShadowManager::getShadowsDisabledDefines();
|
||||
defines["forcePPL"] = "0";
|
||||
defines["clamp"] = "1";
|
||||
for (const auto& define : shadowDefines)
|
||||
defines[define.first] = define.second;
|
||||
mResourceSystem->getSceneManager()->getShaderManager().setGlobalDefines(defines);
|
||||
|
||||
mResourceSystem->getSceneManager()->setShaderPath((resDir / "shaders").string());
|
||||
|
||||
int index = 0;
|
||||
|
@ -15,6 +15,8 @@ namespace SceneUtil
|
||||
public:
|
||||
static void disableShadowsForStateSet(osg::ref_ptr<osg::StateSet> stateSet);
|
||||
|
||||
static Shader::ShaderManager::DefineMap getShadowsDisabledDefines();
|
||||
|
||||
ShadowManager(osg::ref_ptr<osg::Group> sceneRoot, osg::ref_ptr<osg::Group> rootNode, unsigned int outdoorShadowCastingMask, unsigned int indoorShadowCastingMask, Shader::ShaderManager &shaderManager);
|
||||
|
||||
virtual ~ShadowManager() = default;
|
||||
@ -23,8 +25,6 @@ namespace SceneUtil
|
||||
|
||||
virtual Shader::ShaderManager::DefineMap getShadowDefines();
|
||||
|
||||
virtual Shader::ShaderManager::DefineMap getShadowsDisabledDefines();
|
||||
|
||||
virtual void enableIndoorMode();
|
||||
|
||||
virtual void enableOutdoorMode();
|
||||
|
Loading…
x
Reference in New Issue
Block a user