I've made a square plane in 3d space with camera on top, unwrapped it and made uv pass. Everything seems fine however when I apply texture to uv pass it gets significatly distorted. I saw example in https://vimeo.com/138778625 where flat TV surface was used for remapping and in video it worked okay.
How then to make flat re map surface?
You have to Interpret Footage on your UV pass and make sure it's set to "Preserve RGB," and you have to make sure the color depth of your project is set to at least 16bpc.
Preserve RGB tells Ae to bypass its color management system for a footage item, and the project bit depth governs the precision uses for storing images and calculating effects. This is important here because a UV pass is data, not an image.
We need to make sure the RE:Map effect can get access to the raw RGB values, and that it has sufficient precision to avoid distortion.
Specifically, the R and G values will be remapped from their native range to 2D coordinates in texture space (UV), so we want to make sure that no color or gamma processing is being applied to the original values, and that we have sufficient precision in the texture coordinate system.