Force shaders for objects affected by new envmap option

pull/2714/head
Capostrophic 5 years ago
parent 4455c978df
commit 624a9ac353

@ -12,6 +12,7 @@
#include <components/vfs/manager.hpp>
#include <components/sceneutil/riggeometry.hpp>
#include <components/sceneutil/morphgeometry.hpp>
#include <components/settings/settings.hpp>
#include "shadermanager.hpp"
@ -138,6 +139,12 @@ namespace Shader
// Bump maps are off by default as well
writableStateSet->setTextureMode(unit, GL_TEXTURE_2D, osg::StateAttribute::ON);
}
else if (texName == "envMap")
{
static const bool preLightEnv = Settings::Manager::getBool("apply lighting to environment maps", "Shaders");
if (preLightEnv)
mRequirements.back().mShaderRequired = true;
}
}
else
Log(Debug::Error) << "ShaderVisitor encountered unknown texture " << texture;

@ -134,4 +134,4 @@ apply lighting to environment maps
Normally environment map reflections aren't affected by lighting, which makes environment-mapped (and thus bump-mapped objects) glow in the dark.
Morrowind Code Patch includes an option to remedy that by doing environment-mapping before applying lighting, this is the equivalent of that option.
Has no effect in fixed function pipeline.
Affected objects will use shaders.

@ -346,8 +346,8 @@ specular map pattern = _spec
# The filename pattern to probe for when detecting terrain specular maps (see 'auto use terrain specular maps')
terrain specular map pattern = _diffusespec
# Apply lighting to environment map reflections on the rendered objects like in Morrowind Code Patch.
# Requires shaders to work.
# Apply lighting to reflections on the environment-mapped objects like in Morrowind Code Patch.
# Affected objects use shaders.
apply lighting to environment maps = false
[Input]

Loading…
Cancel
Save