animate: Add helix animation
Add helix animation.
The effect works quite well but I think it uses lots of CPU and I also think we can make it work almost entirely on the GPU .. let me know what you think about that.
My initial thought is that it would be a lot of work for relatively little payoff.
The effect works quite well but I think it uses lots of CPU and I also think we can make it work almost entirely on the GPU .. let me know what you think about that.
Looking at this, I have an idea on how to make this less CPU-intensive, because I am getting 50%+ cpu usage even on 1080p (the effect will be much more pronounced on 4k displays since the algorithm is linear in height):
Compute a vertex buffer with strips spanning a simple [0,1]x[0,1] rectangle (the rectangle can be easily scaled to match the view size with a matrix multiplication in the vertex shader).
Based on the actual view height at runtime, we select how many strips to render.
Rotation is also doable in the vertex shader - for example by using something like
floor(gl_VertexID / 6.0you can get the strip index, and from the strip index you can calculate the rotation for the strip.Does that sound about right? Maybe I misunderstand the implementation, but feels like the computation-intensive part of this effect can thus be offloaded completely to the GPU.
Maybe, but I'll leave you to experiment with this idea.
The effect works quite well but I think it uses lots of CPU and I also think we can make it work almost entirely on the GPU .. let me know what you think about that.
You previously mentioned that helix takes about 50% cpu in your tests. I did my own tests, of each animation, running wayfire with nothing more than what is required to do the tests. Here are the results:
Duration: 5000ms
No animation (idle): 2% cpu
Fade: 14% - 2% = 12%
Zoom: 14% - 2% = 12%
Fire: 42% - 2% = 40%
Zap: 14% - 2% = 12%
Spin: 14% - 2% = 12%
Helix: 17% - 2% = 15%
Blinds: 24% - 2% = 22%
Shatter: 40% - 2% = 38%
Vortex: 15% - 2% = 13%
Squeezimize: 18% - 2% = 16%
It seems fire is the worst, at 40%, followed by shatter at 38% and blinds at 22%. Helix is nearly on par with the built-in transformer animations at 15%. Please let me know what you think in light of this.
Closing this because this animation is now part of wayfire-plugins-extra 'extra-animations' plugin.