Open feiss opened 6 years ago
Animating individual properties like opacity over time is something that it is very useful and much required. However, I still didn't find which api and way would be the best to do it.
The problem with changing the opacity of particles individually right now is that we would have to create a single material for each particle, and that would destroy the performance. A gpu shader solution is needed for that. A workaround would be to create a single material per Particle System, but then all smoke particles of each particle system would fade out at the same time.
Both options, individual materials per particle or per particle system, need to animate the material.opacity in the tick() method. You have the relTime variable which goes from 0 to 1 in the life of the particle system.
Definitively it only will be possible in a proper way when the component uses gpu shaders. But I don't have an estimated date for that.
You can use the animation component probably; it can animate arbitrary properties. Once it's in core, you can use it without dependencies and abstract the API more.
well, the problem is not about how to animate, that can be easily done in one line. Is more a problem of performance and material optimization.. maybe I could add a simple opacity fadein/out property to the schema to animate the opacity of a particle system, as a quick and simple workaround.
like randomScale, randomRotation factors, or "scale up to 3x along the animation", "fade out"..