CartoDB / carto-vl

CARTO VL: a Javascript library to create vector-based visualizations
BSD 3-Clause "New" or "Revised" License
129 stars 26 forks source link

Review support for different easing functions on blendTo #491

Open davidmanzanares opened 6 years ago

davidmanzanares commented 6 years ago

In blend, we allowed (a long time ago) the usage of cubic, linear and other interpolation methods.

davidmanzanares commented 5 years ago

To clarify this, apart from the space of the input of a blend (the famous CieLAB vs sRGB), it is important to use easing functions to improve eye candy. See https://easings.net/es

I recommend porting https://github.com/warrenm/AHEasing/blob/master/AHEasing/easing.c to GLSL. (C is very similar to GLSL and the library has a liberal license, although this is not a copy/paste).

Right now, there are a few easing functions in interpolators.js. Some of them ported from the mentioned library.

The current state is that Blend accepts a fourth parameter which is not documented, but it is used by blendToViz to perform cubic easing instead of linear (which I think it's a better default).

I think we should: