From ad016da31d1c36b674262631d406843563a88a83 Mon Sep 17 00:00:00 2001 From: scrawl Date: Tue, 3 Nov 2015 01:42:37 +0100 Subject: [PATCH] Enable fog on weather particles --- apps/openmw/mwrender/sky.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwrender/sky.cpp b/apps/openmw/mwrender/sky.cpp index 0f00b5a4c..3adc565ea 100644 --- a/apps/openmw/mwrender/sky.cpp +++ b/apps/openmw/mwrender/sky.cpp @@ -1457,8 +1457,10 @@ void SkyManager::setWeather(const WeatherResult& weather) if (!mParticleNode) { mParticleNode = new osg::PositionAttitudeTransform; - mParticleNode->getOrCreateStateSet()->setRenderBinDetails(RenderBin_Default, "RenderBin"); - mParticleNode->getOrCreateStateSet()->setNestRenderBins(false); + osg::StateSet* particleStateSet = mParticleNode->getOrCreateStateSet(); + particleStateSet->setRenderBinDetails(RenderBin_Default, "RenderBin"); + particleStateSet->setNestRenderBins(false); + particleStateSet->setMode(GL_FOG, osg::StateAttribute::ON); mRootNode->addChild(mParticleNode); } mParticleEffect = mSceneManager->createInstance(mCurrentParticleEffect, mParticleNode);