Where to start to achieve this effect?

I am not sure but may be distance fields can be used for this.