Mapping a building | After Effects + MadMapper tutorial

in this tutorial, we’ll use After Effects to produce a QuickTime movie that we will remap on a building.
We’ll also need Photoshop to adjust our initial pictures.
The effect we’re after is a Glowing-Scan of the building.
The technique is rather simple, but it illustrates the process to achieve a photo-based architectural mapping.
This tutorial assumes that you know the basics of Adobe Photoshop + After Effects and MadMapper.
You can download a demo version of MadMapper at MadMapper’website

We’ll go from the initial photo on the left to the final mapping on the right:

Select a building to map and make a few pictures of it.
For this tutorial, we’ll need 2 distinct pictures:
- 1 picture of the building that we’ll use as a starting reference point for our mapping. This is typically a ground-level
photo one would take while on location.
- 1 other picture of the building, from a different point of view, in order to really test MadMapper’s ability to map.
This second picture is used to simulate the projector’s point-of-view, for the purpose of this tutorial.

Here’s the first picture we’ll use, loaded into Photoshop:

Now we’ll need to correct the perspective of this photo, in order to have a flat view of the building.
For this task, we can use the Crop tool of Photoshop, with the Perspective option enabled.
Note that since the building is symetrical, we only need one half. This is nice because the right part of the photo
is obstructed by the fountain on the foreground.
So select the relevant part of the building we want to correct, align the gizmo on straight lines.
Note the right part aligned with the middle of the center window and front door.
Once adjusted, press return to apply the perspective cropping.

Create some guides on the straight parts of the building.
Since the cropping was not 100%, we’ll now have to distort manually the image.
Double click the “background” in the layer view, to turn it to a real floating layer.

Now press Command-T to transform this layer. Right click and select Distort.
Adjust the corners to match the straight lines of the building to the guides you just created.
Press return to apply the transformation when you’re done.

Since we have only one side of the building, we’ll need to duplicate it.
Go to Image/CanvasSize to extend the canvas horizontally:

Duplicate the layer and flip it horizontally by pressing Command-T and right click and select Flip.

Mark the features of the building.
First make a black layer and place it on top of the layer stack.
Set its opacity to 70%. That way, we’ll darken the composition.
Make a new layer on the very top of the layer stack.
On that layer, draw some white lines on the main features of the building.
We’ll need this in MadMapper to help us adjust our mapping.
These are in-picture guides that will make your life easier.
As you can see, I’ve just marked a few relevant features, not the whole building.

Resize the file to something usefull, like 1024 by xxx (where the xxx is automaticaly computer by Photoshop)
Here the file is 1024 by 618, which is ok for MadMapper.

Save the Photoshop file as a PSD.
Flatten the composition and save the file again as a JPEG, giving it a different name.
We will need the PSD file containing all the layer for further manipulations in After Effects,
and the flattened JPEG as a guide for MadMApper.

Load After Effects.
Import the PSD file as a composition.
This will make a new composition in After Effects of the size of the PSD file, retaining all the layers.

In After Effects, we now have a bunch of layers.
The architectural lines and the black layer will be useless, so turn them off.
The building is separated in two layers.
Since we want to process the whole building at one, we can group these two layers.
Select them both and go to Layers/Pre-compose. Give them a name, such as “building”

Now let’s make some processing on the building picture.
Here I’ve added a Levels effect, to give some contrast to the photo.

Add a few effects to give a Glowing look to the building.
I’ve added:
- a Find Edges filter, to give a pseudo wireframe look
- a Desaturate filter, to turn the image into grayscale
- a Posterize effect, to reduce the number of shades
- a final Glow filter

Adjust all the filters to get the look you’re after.
Remeber we want to map a Glowing-Scan, so now we’re on the Glowing part.
Here’s my final composite:

Time to setup the scanning part of our mapping.
For this I created a rectangular mask (iclick the icon on top)
that I will animate horizontally.
In the Timeline, adjust the feathering of the mask, to smooth out its outlines.

The mask should look like this:

Animate the mask:
first, move the mask out of the picture stage, to the left, so that the composition is all black:

Then, in the timeline, go to frame 000 (the beginning), and click the little Chronometer icon next to the Mask Path entry.
This will enable the automatic keyframing mode of After Effects.
Each time you’ll move the mask, a keyframe will be created, so you can animate things with just a few clicks.

In the timeline, scrub to the end, at the last frame.
Then move the mask on the other side of the composition.

Keyframes are automatically created, at the beginning and at the end of the timeline.
This way we created an animation.
Note that I have 150 frames in my composition.

Eventually, you can click Play to preview your animation of a Glowing-Scan.

If you jump to the middle of your animation (frame 75), the mask should be in the middle of the picture.
Note that I’ve also animated the MAsk feathering. Feel free to add some more effects if you’re confident
at using After Effects.

Now that our Glowing-Scan effect is set up and ready, we need to render it into a QuickTime movie.
Add the composition to the render queue.

In the Output Module, under the compression settings, be sure to set the codec to Quicktime PhotoJpeg, quality 85.
These are optimal settings for replay in MadMapper of Modul8.
Here, since I don’t have colors, I’ve also set the color depth to Grayscale, in order to save some space on the disk
and gain some performance by the same way.

Select a name (I’ve chosen and Render the file (hit the Render button).

Close After Effects and open up MadMapper.
Now we’ll load both our Flattened JPEG we created in STEP#8 and our Quicktime Movie we just rendered.
Drag and Drop both on the utility column on the right side of MadMapper.
Both files should now be listed, one under the Images section, the other under the Movies section.
For now, double click the flattened JPEG. It should automatically appear in the Input view of MadMapper

Now we can load up another picture of the building in the preview output in order to test the mapping features of MadMapper.
If we were to be on location of the real building, we could skip this step and work directly on the physical architecture.
However, for this tutorial, we’ll work on a background picture, which will just simulate the projector’point of view.
Note that the photo is taken from another point of view of the initial photo we used in AfterEffects.and Photoshop.
To load a background picture, go to the menu bar, Views/Change Preview Background. Load the photo.

Go to the Surface tab of the utility column in MadMapper (second icon)
Create a Quad primitive.

Maximize the preview output. (go to the menu / Views/ Ouput Preview or click the corresponding icon).
Adjust the corners of the Quad to match the perspective of the Background image.
Here you’ll find the Architectural Lines we draw in Photoshop quite useful,
as they allow for a better placement and deformation of the Quad.
Eventually you can modify the Quad’s opacity to see the underlying background.
Try to match the outer contours as much as possible, but DON’T PANIC if the mapping is not perfectly matching.
We’ll fine tune it in the next step.
(Here, the contours are more or less ok, but the center is offset).

Once globally well positioned, enable the Mesh Warping of the Quad,
and add some subdivisions.
Now select the center handles and move them to match the mapping more precisely.
Try to preserve the straight lines.

Now go back to the Media tab, and double your freshly rendered After Effects movie.
This will play the movie over the background, showing you the effect we’re after (mmmm).
The perspective should match.

To prevent any accidental projection on the side of the building,
we can use a few masks.
Go back to the Surface tab, click the mask icon.
Note that the cursor will change to a small crosshair, and that the Creation icon is enabled:

Click some points in the Output Preview to make a mask.
When finished with your current mask shape, press Return to finish the mask.

At any time, to fine tune a mask, select it and enable the edit mode by pressing the edit button:

When this mode is enabled, you can add points to the shape by double clicking on an edge,
and remove points by selecting one and pressing the Delete key.

Continue adding a few more masks.

Once finished adding more masks, your final Output Preview shold look like this:

Congratualtions ! You’ve just finished your mapping setup !
Now feel free to go back to After Effects and make some more complicated footage.

Here’s what the procedure looked like on the real building:

I hope you enjoyed this tutorial.
If you want to try at home, click below to download the two initial photos:

For Photoshop:

For MadMapper Output Preview background:

34 Responses to “Mapping a building | After Effects + MadMapper tutorial”

  1. deepvisual Says:

    couple of things- why mask the top of the building? the light will just fall off into space?
    also, how can you be sure your initial straightening up of the building is accurate? or does it not really matter?

    • Francois Wunschel Says:

      The top is masked to prevent an accidental beam to be seen over the building. (Like when there’s mist. It is always cleaner to completely mask the unused space)
      The initial straightening is NOT 100% accurate, but it doesn’t really matter, since it is possible to adjust it with the GridWarp.

  2. Such a smart and effective technique, thanks for this very interesting tutorial.

  3. great! i will try !

  4. thx for sharing your technique …it has the advantage of doesn’t spending time on technique of focus and much more on creation …

  5. Percival Says:

    Brilliant tutorial Guys, ….. You can use the same Technique Using Dataton Watchout….. instead of Mad Mapper, It allows for some unreal Geometry and Keystone Correction whilst givin you the ability to compose a timeline full of content, so you could have different people working on the same project and generating lots of content :)…..

    but awesome stuff 1024 !!!

    • Wow, that’s great that a $2ooo program can do the same thing. This one is less than 1/4 the price.

    • Lloyd Stewart Says:

      Thanks for the Watchout comment Percival! I already have Watchout, but haven’t fully explored this sort of mapping, which I’ll try now. And by the way Ryan, Watchout is MORE than $2,000.00, and that’s just for one key. But it’s a heckuva program, and like Seinfeld’s Gift of a Wizard Organizer to his TV Dad, “it has other functions”.

      Still, the tutorial was fantastic! One of the best tutorials I’ve ever seen on any topic!!!

  6. This is awesome. Thank you.
    What kind of projectors do you use? What would be an affordable projector that could handle a surface of this size? Approximately How much depth would be needed to achieve the full size of the building?
    I’m starting to think my Epson EX70 will be staying at home, and alternatives must be sought. Any suggestions on ‘Projector Requirements’ would be greatly appreciated

  7. white noise Says:

    just a input, for future updates
    i would be very happy if there would be a mesh warp with bézier curves instead of adding to much point to get a good curve.?
    and it wouldt be great to have edge softener on the masking tool
    (also posibillity to add points tool).. anyway im looking foreward
    its a very cool tool.

    i love nerds.
    your great!

    • Francois Wunschel Says:

      bezier curves are planned.
      edge softener ‘a la’ after effect is planned. (feathering in nerd language;)

      you can already add points by double clicking on a edge, while in edit mode.

  8. [...] quinto tutorial de la serie MadMapper, y  como los anteriores, ha sido elaborado por la gente de 1024. Como en los anteriores yo solo lo he traducido, así que si encontráis algún error [...]

  9. Elemento Says:

    Hi there

    I have just done mapping drawing the masks on top of objects, i am completely new to mapping using photographic techniques, do you require a specific camera to do it properly, could you use after effects or Photoshop to achieve similar result(To change the perspective) as Madmapper?

    Any help will be greatly appreciated

  10. photographers of architecture…

    [...]Mapping a building | After Effects + MadMapper tutorial « 1024 Architecture Blog / MadMapper, Video Mapping, Quartz Composer plugins, whatever …[...]…

  11. siza vieira…

    [...]Mapping a building | After Effects + MadMapper tutorial « 1024 Architecture Blog / MadMapper, Video Mapping, Quartz Composer plugins, whatever …[...]…

  12. hello,
    i have went through the tutorial step by step, but as i drag and drop the video in madmapper it doesn’t go under the movie section, it goes on top, and when i double click on it, madmapper closes unexpectedly !
    can you tell me what would be the problem, i am using madmapper demo , and my os is not 10.6 it’s 10.5.8 do you think that is the problem?!
    thanks :)

  13. [...] and References: Projection Mapping, How to guide Projection Mappping with After Effects More Projection Mapping Examples $(document).ready(function(){ $(".rightColumn").fitVids(); [...]

  14. I don’t drop a bunch of comments, however after reading a few of the comments on Mapping a building | After Effects + MadMapper tutorial 1024 Architecture Blog / MadMapper, Video Mapping, Quartz Composer plugins, whatever . I actually do have some questions for you if it’s okay. Is it only me or does it give the impression like some of the responses come across like they are written by brain dead visitors? :-P And, if you are posting on other online sites, I would like to keep up with anything new you have to post. Could you list of every one of your social pages like your Facebook page, twitter feed, or linkedin profile?

    • Francois Wunschel Says:

      unfortunately we’re not on any social websites.
      no problems for asking questions here.

  15. Somuch Says:

    Thx for the article. It’s so informative. I want to ask a question. How many projector do you need to vizualize the video mapping into the building?

  16. mr wunshcel,

    what do you think of coolux and d3 as compared to madmapper for video mapping and projecting on buildings?

  17. Hi I’ve got one question. How many projectors would you use for the final production of this on site, and in what positions would you place them? I still don’t understand making a truly 3d projection on a building with depth instead of being mainly flat. would you have to make individual left and right video assets for the left and right and hit the building on left and right angles?

    • Also we are running Pandora but my question is more about the overall logistics not about how to do it in any particular software.

    • Francois Wunschel Says:

      I would say that a minimum of 2 powerful (20K) projectors would be a good start.

  18. great tutorial! is it important to map the contours of the building in the output projection? so if there is a window sill, do you have to map the ledges of the windowsill And take that depth into account? a building I like to project onto has a porch with very large columns, and I’m wondering if I have to match the interior wall of the porch and the round shape of the columns?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

Join 663 other followers