mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-06 17:15:35 +00:00
fix particle alpha
This commit is contained in:
parent
4167bdf319
commit
6e2a651252
2 changed files with 3 additions and 8 deletions
|
@ -1809,14 +1809,6 @@ namespace NifOsg
|
|||
if (specFlags == 0)
|
||||
mat->setSpecular(osg::Material::FRONT_AND_BACK, osg::Vec4f(0.f,0.f,0.f,0.f));
|
||||
|
||||
// Particles don't have normals, so can't be diffuse lit.
|
||||
if (particleMaterial)
|
||||
{
|
||||
// NB ignoring diffuse.a()
|
||||
mat->setDiffuse(osg::Material::FRONT_AND_BACK, osg::Vec4f(0,0,0,1));
|
||||
mat->setColorMode(osg::Material::AMBIENT);
|
||||
}
|
||||
|
||||
if (lightmode == 0)
|
||||
{
|
||||
osg::Vec4f diffuse = mat->getDiffuse(osg::Material::FRONT_AND_BACK);
|
||||
|
|
|
@ -159,8 +159,11 @@ void ParticleColorAffector::operate(osgParticle::Particle* particle, double /* d
|
|||
{
|
||||
float time = static_cast<float>(particle->getAge()/particle->getLifeTime());
|
||||
osg::Vec4f color = mData.interpKey(time);
|
||||
float alpha = color.a();
|
||||
color.a() = 1.0f;
|
||||
|
||||
particle->setColorRange(osgParticle::rangev4(color, color));
|
||||
particle->setAlphaRange(osgParticle::rangef(alpha, alpha));
|
||||
}
|
||||
|
||||
GravityAffector::GravityAffector(const Nif::NiGravity *gravity)
|
||||
|
|
Loading…
Reference in a new issue