From f51e06bc473592880bafc3ac33be0f12c1f67846 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 19 Nov 2016 23:47:33 +0100 Subject: [PATCH] Recreate shaders if necessary when the NpcAnimation is rebuilt This fixes certain equipment losing the 'invisibility' effect after a view-mode switch with shaders enabled. Because the initial build of shaders done by the resource manager is not aware of the override state in the NpcAnimation's object root, we have to build new shaders here. --- apps/openmw/mwrender/npcanimation.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/openmw/mwrender/npcanimation.cpp b/apps/openmw/mwrender/npcanimation.cpp index e031afdff..d9dd1a89e 100644 --- a/apps/openmw/mwrender/npcanimation.cpp +++ b/apps/openmw/mwrender/npcanimation.cpp @@ -403,6 +403,9 @@ void NpcAnimation::rebuild() { updateNpcBase(); + if (mAlpha != 1.f) + mResourceSystem->getSceneManager()->recreateShaders(mObjectRoot); + MWBase::Environment::get().getMechanicsManager()->forceStateUpdate(mPtr); }