Camera tracking - Object in 3d view shows in different position when rendered


I’ve got drone footage of one tower, on which I would like to map shadow catcher.
I’ve added the trackers and solved camera motion, and I have very good result of 0.14px error. After that, I’ve added the floor on the tower so that I can begin modeling shadow catcher.

Unfortunately, I can’t put trackers on all the places I would like to because Blender just can’t track them. So, I decided to manually add some empties on the edges of one tower surfaces, I’ve animated them to follow camera motion, and I’ve hooked vertices of the polygon to those emtpies. Here is the screenshot of that polygon which has empties hooked on it’s vertices.

When I play that animation in 3d view, from camera perspective, everything works fine, and everything is mapped as I want it to be. But, once I render it, the surface is totally misplaced? Btw, I’ve tried rendering both in Eevee and Cycles, and the result is the same.

Can somebody help me, what is going on? :slight_smile:

Ok, I’ve found out what is going on.
It seems that once you setup tracking scene, among other things, Blender automatically generates “undistortion” node in compositor, which is there to correct lens distortion. At least that’s how I understand that :slight_smile:

But, that node unfortunately distorts too much my final image, and therefore I’ve disabled it in the compositor. Here is render with “undistortion” node active, so that you can see how much distortion it does. As you can see, edges are totally distorted and that is unfortunately unacceptable for me.

So, having this in mind, what would be your advice for me how to solve this?

LOL, ok, I’ve solved this :slight_smile:

So, for someone in the future with the same problem, here is the solution.
You just have to copy “undistortion” node in the compositor, and put it before the composite and viewer node.
Then, instead of “undistort” switch to “distort” mode, and that’s it!
It will compensate for the previous distortion (or better said undistortion) that same node has done, and everything will match perfectly!