forked from teamnwah/openmw-tes3coop
Enable particle lighting
This commit is contained in:
parent
68e322f969
commit
0a411cbd7c
2 changed files with 12 additions and 4 deletions
|
@ -1067,6 +1067,9 @@ namespace MWRender
|
|||
parentNode = found->second;
|
||||
}
|
||||
osg::ref_ptr<osg::Node> node = mResourceSystem->getSceneManager()->createInstance(model, parentNode);
|
||||
|
||||
node->getOrCreateStateSet()->setMode(GL_LIGHTING, osg::StateAttribute::OFF);
|
||||
|
||||
params.mObjects = PartHolderPtr(new PartHolder(node));
|
||||
|
||||
SceneUtil::FindMaxControllerLengthVisitor findMaxLengthVisitor;
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
#include <osg/Geometry>
|
||||
#include <osg/Array>
|
||||
|
||||
#include <osg/ShapeDrawable>
|
||||
#include <osg/ComputeBoundsVisitor>
|
||||
|
||||
// resource
|
||||
#include <components/misc/stringops.hpp>
|
||||
#include <components/misc/resourcehelpers.hpp>
|
||||
|
@ -862,7 +859,15 @@ namespace NifOsg
|
|||
collectMaterialProperties(nifNode, materialProps);
|
||||
applyMaterialProperties(geode, materialProps, true, animflags);
|
||||
|
||||
partsys->getOrCreateStateSet()->setMode(GL_LIGHTING, osg::StateAttribute::OFF);
|
||||
// Particles don't have normals, so can't be diffuse lit.
|
||||
osg::Material* mat = static_cast<osg::Material*>(geode->getStateSet()->getAttribute(osg::StateAttribute::MATERIAL));
|
||||
if (mat)
|
||||
{
|
||||
osg::Vec4f diffuse = mat->getDiffuse(osg::Material::FRONT_AND_BACK);
|
||||
mat->setDiffuse(osg::Material::FRONT_AND_BACK, osg::Vec4f(0,0,0,diffuse.a()));
|
||||
mat->setColorMode(osg::Material::AMBIENT);
|
||||
}
|
||||
|
||||
partsys->getOrCreateStateSet()->setRenderingHint(osg::StateSet::TRANSPARENT_BIN);
|
||||
|
||||
// particle system updater (after the emitters and affectors in the scene graph)
|
||||
|
|
Loading…
Reference in a new issue