mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-04 03:40:14 +00:00
add white ambient to spell VFX as in Morrowind
This commit is contained in:
parent
69319cea31
commit
8216410e7d
@ -18,6 +18,7 @@
|
|||||||
Bug #4602: Robert's Bodies: crash inside createInstance()
|
Bug #4602: Robert's Bodies: crash inside createInstance()
|
||||||
Bug #4700: Editor: Incorrect command implementation
|
Bug #4700: Editor: Incorrect command implementation
|
||||||
Bug #4744: Invisible particles must still be processed
|
Bug #4744: Invisible particles must still be processed
|
||||||
|
Bug #4949: Incorrect particle lighting
|
||||||
Bug #5088: Sky abruptly changes direction during certain weather transitions
|
Bug #5088: Sky abruptly changes direction during certain weather transitions
|
||||||
Bug #5100: Persuasion doesn't always clamp the resulting disposition
|
Bug #5100: Persuasion doesn't always clamp the resulting disposition
|
||||||
Bug #5120: Scripted object spawning updates physics system
|
Bug #5120: Scripted object spawning updates physics system
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
#include <osg/BlendFunc>
|
#include <osg/BlendFunc>
|
||||||
#include <osg/Material>
|
#include <osg/Material>
|
||||||
#include <osg/Switch>
|
#include <osg/Switch>
|
||||||
|
#include <osg/LightModel>
|
||||||
|
|
||||||
#include <osgParticle/ParticleSystem>
|
#include <osgParticle/ParticleSystem>
|
||||||
#include <osgParticle/ParticleProcessor>
|
#include <osgParticle/ParticleProcessor>
|
||||||
@ -372,6 +373,19 @@ namespace
|
|||||||
private:
|
private:
|
||||||
int mEffectId;
|
int mEffectId;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
osg::ref_ptr<osg::LightModel> getVFXLightModelInstance()
|
||||||
|
{
|
||||||
|
static osg::ref_ptr<osg::LightModel> lightModel = nullptr;
|
||||||
|
|
||||||
|
if (!lightModel)
|
||||||
|
{
|
||||||
|
lightModel = new osg::LightModel;
|
||||||
|
lightModel->setAmbientIntensity({1,1,1,1});
|
||||||
|
}
|
||||||
|
|
||||||
|
return lightModel;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace MWRender
|
namespace MWRender
|
||||||
@ -1547,7 +1561,9 @@ namespace MWRender
|
|||||||
parentNode->addChild(trans);
|
parentNode->addChild(trans);
|
||||||
|
|
||||||
osg::ref_ptr<osg::Node> node = mResourceSystem->getSceneManager()->getInstance(model, trans);
|
osg::ref_ptr<osg::Node> node = mResourceSystem->getSceneManager()->getInstance(model, trans);
|
||||||
node->getOrCreateStateSet()->setMode(GL_LIGHTING, osg::StateAttribute::OFF);
|
|
||||||
|
// Morrowind has a white ambient light attached to the root VFX node of the scenegraph
|
||||||
|
node->getOrCreateStateSet()->setAttributeAndModes(getVFXLightModelInstance(), osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE);
|
||||||
|
|
||||||
SceneUtil::FindMaxControllerLengthVisitor findMaxLengthVisitor;
|
SceneUtil::FindMaxControllerLengthVisitor findMaxLengthVisitor;
|
||||||
node->accept(findMaxLengthVisitor);
|
node->accept(findMaxLengthVisitor);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user