sarbian / SmokeScreen

BSD 2-Clause "Simplified" License
16 stars 14 forks source link

Improve decluster -> In addition to applying distance, apply size, and remove particle lifetime, therefore better simulating the particle as if it was emitted between frames #36

Closed PatPL closed 5 years ago

PatPL commented 5 years ago

This change adds to particle's size on Emit, similar to how it adds distance. Other that that, it also subtracts appropiate amount of time from particle's remaining lifetime to improve color animation smoothness across particles spawned in one frame.

smokescreamaaaaaaaaaaaaaaaaa

This change also tweaked some logic responsible for detecting if particle was spawned this frame

// (particle = particles[j])

// Previous:
particle.remainingLifetime == particle.startLifetime

// Current:
j >= numParticlesAlive - ParticlesThisFrame

This change most likely won't be visible on most regular plumes. It's most visible on quickly expanding, high velocity plumes