GPUParticles: Use smoothstep for fade out and remove direction modulation by size.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14944 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
vincentlj 2014-01-06 22:35:54 +00:00
parent 6808a9df1a
commit 7a95d46448
2 changed files with 4 additions and 4 deletions

View File

@ -21,5 +21,5 @@ void main(void)
float len = dot(vec3(1.0), abs(texture2D(normals_and_depth, xy).xyz));
float alpha = (len < 0.2) ? 1. : clamp((EnvPos.z - FragmentPos.z) * 0.3, 0., 1.);
color = texture2D(texture, tc);
color.a *= alpha * (1. - lf);
color.a *= alpha * smoothstep(1., 0.8, lf);
}

View File

@ -116,9 +116,9 @@ void generateLifetimeSizeDirection(scene::IParticleEmitter *emitter, float &life
particledir.rotateYZBy(os::Randomizer::frand() * emitter->getMaxAngleDegrees());
particledir.rotateXZBy(os::Randomizer::frand() * emitter->getMaxAngleDegrees());
dirX = particledir.X / size;
dirY = particledir.Y / size;
dirZ = particledir.Z / size;
dirX = particledir.X;
dirY = particledir.Y;
dirZ = particledir.Z;
}
struct ParticleData