fine tuned explosion parameters.

This commit is contained in:
Andreas Ortmann 2016-09-30 22:25:37 +02:00
parent c950d6a54d
commit 03998dc74a
2 changed files with 19 additions and 12 deletions

View file

@ -17,9 +17,13 @@ varying float explCenterDist;
// TODO: rotate to face the user!
void main()
{
// add a bit variation to the decay compution by adding part of the initial
// position to the age
float ageMod = age + mod(20.0*in_position.z + 10.0*in_position.x + in_position.y, 0.5);
//decay = min(1.0, age+5.0*length(velocity)) / halfAge;
//decay = max(decay*decay, sqrt(decay));
decay = age / halfAge;
decay = ageMod / halfAge;
// faster particles are smaller
float speedScale = (1.0 - 0.8*length(in_velocity)/maxVelocity);