From 6b6c732a59787ca2707cf02650677dc5fe39c245 Mon Sep 17 00:00:00 2001 From: "glassmancody.info" Date: Tue, 3 Jan 2023 10:16:30 -0800 Subject: [PATCH] properly update postprocess uniform for sun position in interiors --- apps/openmw/mwrender/renderingmanager.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index cb5ad8d9a6..ca71532828 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -771,9 +771,11 @@ namespace MWRender setAmbientColour(ambient); osg::Vec4f diffuse = SceneUtil::colourFromRGB(cell->mAmbi.mSunlight); - mSunLight->setDiffuse(diffuse); - mSunLight->setSpecular(diffuse); - mSunLight->setPosition(osg::Vec4f(-0.15f, 0.15f, 1.f, 0.f)); + setSunColour(diffuse, diffuse, 1.f); + + const osg::Vec4f interiorSunPos = osg::Vec4f(-0.15f, 0.15f, 1.f, 0.f); + mPostProcessor->getStateUpdater()->setSunPos(interiorSunPos, false); + mSunLight->setPosition(interiorSunPos); } void RenderingManager::setSunColour(const osg::Vec4f& diffuse, const osg::Vec4f& specular, float sunVis)