How does three implement the replacement face mapping functionality

How to realize the replacement face map function of three, the effect shown in the following video, you have a good reference case and solutions to provide, thank you
20170726115826585