mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-31 14:36:39 +00:00
Disable lighting for particles
Fixes magic cast visuals being too dark depending on the environment.
This commit is contained in:
parent
4648524df4
commit
c69a311ad8
3 changed files with 14 additions and 3 deletions
|
@ -106,7 +106,7 @@ Ogre::String NIFMaterialLoader::getMaterial(const Nif::ShapeData *shapedata,
|
||||||
const Nif::NiZBufferProperty *zprop,
|
const Nif::NiZBufferProperty *zprop,
|
||||||
const Nif::NiSpecularProperty *specprop,
|
const Nif::NiSpecularProperty *specprop,
|
||||||
const Nif::NiWireframeProperty *wireprop,
|
const Nif::NiWireframeProperty *wireprop,
|
||||||
bool &needTangents)
|
bool &needTangents, bool disableLighting)
|
||||||
{
|
{
|
||||||
Ogre::MaterialManager &matMgr = Ogre::MaterialManager::getSingleton();
|
Ogre::MaterialManager &matMgr = Ogre::MaterialManager::getSingleton();
|
||||||
Ogre::MaterialPtr material = matMgr.getByName(name);
|
Ogre::MaterialPtr material = matMgr.getByName(name);
|
||||||
|
@ -245,6 +245,14 @@ Ogre::String NIFMaterialLoader::getMaterial(const Nif::ShapeData *shapedata,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (disableLighting)
|
||||||
|
{
|
||||||
|
ambient = Ogre::Vector3(0.f);
|
||||||
|
diffuse = Ogre::Vector3(0.f);
|
||||||
|
specular = Ogre::Vector3(0.f);
|
||||||
|
emissive = Ogre::Vector3(1.f);
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
// Generate a hash out of all properties that can affect the material.
|
// Generate a hash out of all properties that can affect the material.
|
||||||
size_t h = 0;
|
size_t h = 0;
|
||||||
|
|
|
@ -49,7 +49,7 @@ public:
|
||||||
const Nif::NiZBufferProperty *zprop,
|
const Nif::NiZBufferProperty *zprop,
|
||||||
const Nif::NiSpecularProperty *specprop,
|
const Nif::NiSpecularProperty *specprop,
|
||||||
const Nif::NiWireframeProperty *wireprop,
|
const Nif::NiWireframeProperty *wireprop,
|
||||||
bool &needTangents);
|
bool &needTangents, bool disableLighting=false);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -850,7 +850,10 @@ class NIFObjectLoader
|
||||||
partsys->setMaterialName(NIFMaterialLoader::getMaterial(particledata, fullname, group,
|
partsys->setMaterialName(NIFMaterialLoader::getMaterial(particledata, fullname, group,
|
||||||
texprop, matprop, alphaprop,
|
texprop, matprop, alphaprop,
|
||||||
vertprop, zprop, specprop,
|
vertprop, zprop, specprop,
|
||||||
wireprop, needTangents));
|
wireprop, needTangents,
|
||||||
|
// MW doesn't light particles, but the MaterialProperty
|
||||||
|
// used still has lighting, so that must be ignored.
|
||||||
|
true));
|
||||||
|
|
||||||
partsys->setCullIndividually(false);
|
partsys->setCullIndividually(false);
|
||||||
partsys->setParticleQuota(particledata->numParticles);
|
partsys->setParticleQuota(particledata->numParticles);
|
||||||
|
|
Loading…
Reference in a new issue