From 59cfcb38e28dbafcb25d08f05dd57945b82076de Mon Sep 17 00:00:00 2001 From: scrawl Date: Tue, 10 May 2016 17:39:57 +0200 Subject: [PATCH] Scale the sunlight specular color by weather's GlareView value (Fixes #3375) --- apps/openmw/mwrender/renderingmanager.cpp | 6 +++--- apps/openmw/mwrender/renderingmanager.hpp | 2 +- apps/openmw/mwworld/weather.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index 52a0b2c61..ea3e7b7ee 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -351,11 +351,11 @@ namespace MWRender mSunLight->setDirection(osg::Vec3f(1.f,-1.f,-1.f)); } - void RenderingManager::setSunColour(const osg::Vec4f &colour) + void RenderingManager::setSunColour(const osg::Vec4f& diffuse, const osg::Vec4f& specular) { // need to wrap this in a StateUpdater? - mSunLight->setDiffuse(colour); - mSunLight->setSpecular(colour); + mSunLight->setDiffuse(diffuse); + mSunLight->setSpecular(specular); } void RenderingManager::setSunDirection(const osg::Vec3f &direction) diff --git a/apps/openmw/mwrender/renderingmanager.hpp b/apps/openmw/mwrender/renderingmanager.hpp index 59692f45a..ebe75d39b 100644 --- a/apps/openmw/mwrender/renderingmanager.hpp +++ b/apps/openmw/mwrender/renderingmanager.hpp @@ -91,7 +91,7 @@ namespace MWRender void skySetMoonColour(bool red); void setSunDirection(const osg::Vec3f& direction); - void setSunColour(const osg::Vec4f& colour); + void setSunColour(const osg::Vec4f& diffuse, const osg::Vec4f& specular); void configureAmbient(const ESM::Cell* cell); void configureFog(const ESM::Cell* cell); diff --git a/apps/openmw/mwworld/weather.cpp b/apps/openmw/mwworld/weather.cpp index 03e7b581a..5987e1971 100644 --- a/apps/openmw/mwworld/weather.cpp +++ b/apps/openmw/mwworld/weather.cpp @@ -722,7 +722,7 @@ void WeatherManager::update(float duration, bool paused) mRendering.configureFog(mResult.mFogDepth, underwaterFog, mResult.mFogColor); mRendering.setAmbientColour(mResult.mAmbientColor); - mRendering.setSunColour(mResult.mSunColor); + mRendering.setSunColour(mResult.mSunColor, mResult.mSunColor * mResult.mGlareView); mRendering.getSkyManager()->setWeather(mResult);