diff --git a/data/shaders/particle.frag b/data/shaders/particle.frag index 3587367b0..08157c24e 100644 --- a/data/shaders/particle.frag +++ b/data/shaders/particle.frag @@ -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); } diff --git a/src/graphics/gpuparticles.cpp b/src/graphics/gpuparticles.cpp index 34285e935..1de3853ec 100644 --- a/src/graphics/gpuparticles.cpp +++ b/src/graphics/gpuparticles.cpp @@ -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