1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-26 06:40:22 +00:00

Merge branch 'light' into 'master'

Fix emissive in character preview

See merge request OpenMW/openmw!2088
This commit is contained in:
psi29a 2022-07-04 06:56:23 +00:00
commit bc3421642d

View File

@ -268,12 +268,15 @@ namespace MWRender
fog->setEnd(10000000);
stateset->setAttributeAndModes(fog, osg::StateAttribute::OFF|osg::StateAttribute::OVERRIDE);
// turn of sky blending
// TODO: Clean up this mess of loose uniforms that shaders depend on.
// turn off sky blending
stateset->addUniform(new osg::Uniform("far", 10000000.0f));
stateset->addUniform(new osg::Uniform("skyBlendingStart", 8000000.0f));
stateset->addUniform(new osg::Uniform("sky", 0));
stateset->addUniform(new osg::Uniform("screenRes", osg::Vec2f{1, 1}));
stateset->addUniform(new osg::Uniform("emissiveMult", 1.f));
// Opaque stuff must have 1 as its fragment alpha as the FBO is translucent, so having blending off isn't enough
osg::ref_ptr<osg::TexEnvCombine> noBlendAlphaEnv = new osg::TexEnvCombine();
noBlendAlphaEnv->setCombine_Alpha(osg::TexEnvCombine::REPLACE);