Friday, June 3, 2022

MadMapper - Separate composition from projector correction

MadMapper lets you create layers and distort them. This can be used for creative layouts, and to fit projected content to real irregular surfaces.

The problem comes when you need to use MadMapper to do projector correction, e.g. because you are projecting from an angle onto an irregular surface, but you also want to do a creative layout, e.g. have a bunch of circular images in different places on that surface. In this case you have to correct every layer based on the projector angle and the surface it hits. But circles don't have mesh warping. And even if you distort a circle to look good in one place, that could fall apart if you move it to a different place on an irregular surface, e.g. across a bend in the wall.

What you really want to do is to correct once for the relationship between your projector and your surface, and then have all your layers run through that correction. Then a perfect circle layer would be a perfect circle on the wall, no matter where you drag it.

MadMapper does not let you do perspective correction or mesh warping on the projector output, but there is a workaround.

In the projectors tab, rename your projector output to "loopback for correction" and send it to syphon. Now make a new projector called "projector", select your projector as output, and place it far away in the workspace so you don't have to worry about spill. You probably want to make the loopback the same dimensions as the real projector. In the layers tab, make a new layer "projector correction" and select as its input "Syphon: MadMapper - loopback for correction". Make sure that the input is capturing the full area of the loopback, and set the output to snap to the four corners of the faraway "projector" output.

Now, you can use perspective and mesh warping on the "projector correction" layer to correct for the relationship between your projector and projection surface. And all your other layers on the primary output (which is now named "loopback for correction") don't have to care about those details. A perfect circle layer will be a perfect circle on the wall, and as you drag it around it will run through the mesh warping so that it is distorted correctly to appear perfect wherever it goes.