Camera Projection Mapping in Maya

Tutorial Details
  • Software: Autodesk Maya
  • Difficulty: Intermediate
  • Estimated Completion Time: 2 Hours

Camera Projection Mapping is the process of projecting an image onto simple geometry creating the illusion of detail and movement from what is really just a still image. This method has been used by many matte painters in the film and television industries. Camera projection mapping is a very handy technique to learn, but it can also be quite difficult to master. This tutorial will demonstrate how to create a Motion Design clip using camera projection mapping.


Final Effect Preview


Step 1

Open a new scene in Maya. Under the Create menu go to Cameras > Camera. This will create a new camera in your scene, that will be used to project the image onto the geometry.


Step 2

With the new camera selected, go to the channel box, double click on the camera’s name camera 1, and change the name to Proj_cam.


Step 3

Translate (move) the camera towards the end of the grid on the Z axis. Then with Proj cam selected go to Panels > Look Through Selected.


Step 4

In the viewport go to View > Camera Settings > Resolution Gate.


Step 5

Change the resolution size of the final output from the default 640 X 480 by going to the rendering shelf and clicking on the render settings button. Under the Image Size tab change the Width to 864, and the Height to 486.


Step 6

In this step you will import the image that you will be projecting onto geometry. In the viewport go to View > Image Plane > Import Image. Then select your image. Press Ctrl + A to bring up the image attributes.


Step 7

Check the radio button ’looking through camera.’


Step 8

Scroll down to the Placement tab, under the Fit dropdown menu select Fill and then click Fit to Resolution Gate.


Step 9

Go to Create > Polygon > Cube to create a cube. Turning off interactive creation may help at this point.


Step 10

Translate, scale and rotate the cube and the camera until the cube is lined up roughly with your image.


Step 11

Right click on the model, and then select vertices in the mark up menu. Translate the vertices until it fits the middle building in the photo more accurately.


Step 12

Press ctrl +D with the cube selected to duplicate it. Do this twice, and scale the blocks until they resemble the buildings on either side of the main tower in the photo.


Step 13

The next step is to create a plain to receive the projection of the background. Go to Create > Polygon Primitives > Plain. Rotate and scale the plain until it is behind the buildings you have modeled.


Step 14

Add a shader by going to Window > Rendering Editors > Hypershade. This will bring up the Hypershade window.


Step 15

Click on the Lambert icon under the Create Maya nodes > Surface tab. This will add a new Lambert material to the Hypershades work area. Select the shader, and press ctrl + A to open up the material Attributes editor.


Step 16

Change the name of the Lambert shader to Projection and click on the checkered box next to the Colour material attribute. This will open up the Create Render Node window.


Step 17

Select the As projection radio button and then click on the File icon.


Step 18

Under the Projection Attributes window, select Perspective as the Proj Type. Under the Camera Projection Attributes tab, select Proj_camshape under the Link To Camera drop down menu, and set Fit Type to Match Camera Resolution. Click the button next to the Image attribute.


Step 19

Load a projected image of your choosing into the scene.


Step 20

Select the Proj_cam and press ctrl +D to duplicate it. Call the new camera Render cam. Under the Rendering tab, click Render > Render Current Frame for a test render. Press the Keep Image button in the render window.


Step 21

Select the Render cam and press S on the keyboard to set a key frame. Move to frame 200, and then rotate the camera to a slightly different angle. Render again. This way you can see if the projection is working by moving the slider back and forth in the render window.


Step 22

Go to Create > Text > ? to bring up the text curve options. In the Text window, type Urban, and choose any font that you want by clicking on the downward arrow. Select Poly as the Type, and then click Create.


Step 23

With the text selected, go to Mesh > Combine.


Step 24

Right click on the text, pull the curser down to Face and select all of the faces.


Step 25

Click on Edit Mesh > Extrude, and make sure the Keep Faces Together option is turned on. Pull the faces outward to give the text some thickness.


Step 26

Repeat the previous steps to create the word ‘Motion’. Reduce its size by toggling the scale attributes.


Step 27

Go to Create > Polygon Primitive > Cylinder. To change the cylinder to a hexagon, change the Subdivisions Axis to 6. Reduce the Scale on the Y axis to flatten the hexagon. Change the name to ‘Hex’, and then press ctrl + D three times so that there are four different hexagons.


Step 28

Select the text, and all four hexagons, and group them together by pressing ctrl + G. Name it ‘Urban_group’, and move it to a suitable place in front of the camera.


Step 29

Select ‘Urban’ and press the insert key on your keyboard. This allows you to move the pivot point of your manipulator and will come in handy when you are animating. Move the manipulator to the left of the text closer to the building and then press insert again.


Step 30

With ‘Urban’ still selected, go to frame 120 and press S on the keyboard to create a key frame. Move the slider back to frame 100, and then scale ‘Urban’ down on the X, Y, and Z, axis down to 0.


Step 31

Select the largest hexagon, and move the manipulator as you have in the previous step. Go to frame 130 and press S. Repeat the previous step with the largest hexagonal object (this should be named ‘hex’). Now move to frame 120, and scale down to 0 on the X,Y,Z. You can also add a random rotation if you like.


Step 32

Select the word, ‘Motion’ and move the manipulator to the bottom of the word. Go to frame 150, and press S, then go back to frame 130, and rotate on the X axis by about 360 degrees and scale all of the axes to 0.


Step 33

Animate the remaining hexagons using the same methods. Set the pivot point manipulators within the object that you want it to appear out of in 10 frame increments. For example set the pivot point of ‘Hex 1’ into ‘Hex’ scale to 0. ‘Hex 2’ into ‘Hex 1’ and so on.


Step 34

Open the Hypershade window again. Create a new Phong material, and name this material ‘marble’. Turn Ambient Colour and Incandescence all the way down, but turn Transparency up. Add a marble patterned source image to the Colour node, making sure the radial button on the Source render node is no longer on As Projection, and is instead set to Normal.


Step 35

Repeat the previous steps twice, but add two separate source images to the Phong materials so that you have three new materials. Name the new materials ’ Urban_shader’, and ‘motion_shader.’ Apply the marble shader to the hexagon objects, the ‘Urban shader to Urban’, and the ‘Motion Shader’ to ‘Motion.’


Step 36

Select all of the objects in the scene, then go to the Render layer editor and create a new layer. Assign the objects to it by pressing on the button on the bottom right of the Render editor. By double clicking on the new layer you can rename it. Change the name of the layer to ‘Master’ and then click, Save.


Step 37

Create three new layers, and add all of the objects in the scene to each of them. Rename these layers, ‘Occlusion,’ ‘Specular,’ and ‘Reflection’. Right click on the ‘Occlusion’ layer to access the preset menu, and select Occlusion.


Step 38

You will need to create a shader to add to the objects in the ‘Specular’ layer. Do this by creating a new Phong material, and call it Spec_shader. Turn the slider down on the Colour, Transparency, Ambient Colour, Incandescence, and Diffuse options. Turn the Specular Colour to white, and the Cosine Power to 45. Go to the ‘Specular’ layer, and apply this shader to all of the objects therein.


Step 39

Press ctrl + D to duplicate the ‘Specular’ shader that you have just created, and name it ‘Reflect_shader’. Turn the Reflectivity slider up all the way to the maximum value of 1. Assign this shader to all of the objects in the ‘Reflect’ layer.


Step 40

Now you need an environment for the shader to reflect. Go to Create > Polygon Primatives > Sphere. Scale it up to 18.562 on the x,y, and z axes. Assign a new Lambert shader to the sphere, click on the Colour node, and choose the same image that you are projecting as the source image.


Step 41

You only want the textured sphere to be shown in reflections, so what you will need to do is select the sphere, and press ctrl + A to bring up the objects Attributes editor. Under the Render Stats tab, deselect the Primary Visibility checkbox.


Step 42

Do a test render of the reflection layer.


Step 43

Open up the Render Settings window again. Under the Common tab, make sure the Frame/Animation ext is set to name.#ext. The Image Format should be set to PNG, and the End frame should be set to 200. Renderable Camera should be set to render_cam. Go to the mental ray tab and set the Quality preset to Production. Make sure that all render layers apart from the default MASTERLAYER are checked. Finally, make note of where the rendered files will be saved to (they are normally saved in the image directory).


Step 44

Under the Rendering menu set, click on Render > Batch Render. Wait until the render is complete and then go to After Effects for the compositing stage.


Step 45

Open up After Effects then go to File > Import > File.


Step 46

Navigate until you find the folders that have been named after your render layers. Open ‘Master’, and click on the first file in the sequence. Make sure the PNG Sequence tickbox is selected, and then click Open. This will import the entire rendered image sequence. Do this with all of the other layers that you rendered out from Maya.


Step 47

By dragging one of the imported image sequences onto the new composition button, the comp inherits the image size and length of the footage that you have imported. All of the other layers can now be dragged onto the timeline.


Step 48

By clicking on Toggle Switches/Modes at the bottom of the window, you can see different transfer modes. Make sure the ‘Ambient Occlusion’ layer is set to Multiply, and is above the ‘Master’ layer. The ‘Reflect’ layer should be set to Overlay, and the ‘Specular’ layer should be set to Screen. ‘Specular’ should be the top layer, and ‘Reflect’ should be second from the top.
p>


Step 49

To add a slight haze, create a new Adjustment Layer. Set the transfer mode of this layer to Add, and adjust its opacity as you see fit.
.


Step 50

That’s it! Hope you learned something new here!!

Don’t miss more CG tutorials and guides, published daily – subscribe to Cgtuts+ by RSS.

  • Daniel Grid

    very nice tut, but i dont know why i heat written tuts. cool one again

  • Daniel Amedoda
    Author

    Thank you I am glad you enjoyed it Daniel, I would have done a video tutorial but I don’t have the sound recording equipment.

  • Infaas

    Hey Dan, can you teach us how to achieve this using 3ds max ? Or is it too easy to write a tut on it ?

    • Daniel Amedoda
      Author

      Hi there, I am not a 3ds max user, however when I was researching this topic I came across allot of learning material, for many different programs including 3ds max, send me an e-mail and I will pass on some of the information I found.

  • http://www.lsmworks.com/ Amila C

    hmmm, nice tute. and can u do a tute for a landscape matte painting with camera projection? i think that will be usefull for people . . . .

    good luck . .

    • Daniel Amedoda
      Author

      Hi Aimila,

      In time I will do something like that involving a futuristic city scape and lots of intergration with Photoshop.

  • http://www.dercreations.com/ Der

    Hi and good tutorail. I have a problem in mental ray mi result my result is damaged, in maya software no. Why?

    • Daniel Amedoda
      Author

      Hi Der, I am glad that you liked it.

      I am not to sure what you mean by ‘damaged’ What error message comes up in Maya when you render in mental ray?

  • http://www.cgwhat.com arnel

    i must say that was the dumbest thing i have ever seen i mean what is the purpes you could have just created the stupid thing in maya then tooking it to After Effects and put a mask on and the animation was also way way to fast

    • Daniel Amedoda
      Author

      Arnel,

      Thanks for your feedback. If you have a better way of achieving the end result, I am sure we would all benefit by you being a bit more descriptive.
      As a professional its also not advisable for you to hide behind the internet and insult peoples work without offering any form of constructive criticism. It’s not nice to try and belittle somebodies work because you think you are in some way superior. By using words like “dumbest”, “stupid” You reveal your own mental maturity, and that just isn’t cool. If you are prepared to offer a tutorial on camera projection mapping I will be glad to watch.

      Thank you.

      Daniel

      • http://kaleb-3d.com Kaleb Aylsworth

        +2

      • Anthony Breslin

        Exactly Daniel. Great tutorial man :)

      • http://gerascgarts.yolasite.com/ Andrew

        Daniel, that was a cool answer.. so polite and constructive.

  • Jeff

    Hi Daniel thanks for this tutorial. Just want to ask, If I have the model already in maya that needs to be align in a photomontage image. Whats the best way to camera match this in the image plane in maya? Its just a still image.

    thanks

    Jeff

    • Daniel Amedoda
      Author

      Hey Jeff,

      I hope you are doing well. Lining up the image and the geometry is the trickiest part in my opinion. This is why at times I use multiple view ports, one view port shows the scene through the projection camera, and the other may be the top or one of the sides.
      Another method that can be used sometimes is adding temporary geometry as a point of reference, like a ground plain or a cube that lines up exactly to key points in the image. I understand that this may be a bit tricky so if you have any questions, you can send them to my e-mail address Daniel@acreativemind.net Send screen shots of your view ports and the image you would like to use, and I will try my best to help you the best I can.

      Daniel

      • Jeff

        Thanks Daniel for your suggestion I’ll try doing the reference for a start. I’ll email the screenshots

        thanks

        jeff

  • harley

    hi! nice tutorial, thanks for this…
    it is kinda hard for me to understand though
    do you have a video version of this tutorial?
    please send me a link if there is one! please!
    thanks!

    • Daniel Amedoda
      Author

      Hey Harley,

      I am very sorry but I don’t have any audio recording equipment so I am unable to make video tutorials right now. Please let me know which steps in the tutorial you are having trouble with and I will try my best to simplify an explanation. You can also contact me by e-mail.

      Daniel

  • Hassan

    Woot woot! MORE MAYA TUTORIALS CGTUTS!!!!!!!!

  • frankyframe

    great, this is what i needed
    but it would be more helpfull if the footage will be offered

    thx for the tut

  • jeffin

    thanks for your tutorial, it really helped me. can we bake these textures we are projecting to the objects..? please let me know.. once again thanks for your tutorial..

    • Daniel Amedoda

      Hey Jeff, thanks alot.

      I have heard there is a way to bake the textures on to a projection, I will try and find a way to do it and get back to you.

      • http://www.ranger3d.como Ranger

        Hi, the way to do this is to create a texture reference object, which will make the texture stick to the geo now, rather than stay with the projection cam.

  • http://www.vimeo.com/weluvmovies Brad

    Hi Daniel,

    I got to step 20 and all that happens when I render is I get a grey version of all the geometry I modeled. I am a newbie and don’t know all the concepts of 3D rendering/modeling. I’ve made sure I am rendering the “Render Cam” in the render settings.

    My projection just isn’t projecting? Am I supposed to apply the “render node” to something, because all your instructions say is to create a render node, then under “Link to Camera” select the “proj_cam”, is that really it? I’m using Maya 2011 if that makes a difference to the process.

    Please help, I really enjoy this effect and it would make my week if I could understand what I’m doing wrong.

    Thanks!

  • chris

    Hello,
    Thanks for podting this tutorial.

    I’m also getting stuck at the same stage as brad (comment above). Surely the shader we create in the hypershade node needs to be applied somehow so that it affects all the geometry in the scene.
    At the momrent, I just get grey geometry when I render the frame too.
    Hoping there’s some advice for us both… (I.m using Maya 8.5)
    with thanks
    Chris

    • http://www.vimeo.com/weluvmovies Brad Alicea

      Hey Chris,

      I did figure out that you need to apply the shader to the object in maya 2011 I can do this by right clicking the geometry and apply the material to that object… this got me past this first step, but now I’m having trouble figuring out how to animate the camera… so if anyone has any tips?

      The only camera I can view is the “persp” camera from the view… if I render my “render_cam” I only get pure black.

      Just messing around until I get it to work I guess.

  • http://www.vimeo.com/weluvmovies Brad

    I also created a second shader for each the building and the background.

  • http://www.vimeo.com/weluvmovies Brad

    Still stuck on STEP 20:

    The problem I am having is my image is not lining up. When I look through the camera(render or projection camera) I see my model aligned with my image plane in the viewport. But when I render the current frame my image is skewed horizontally.

    It seems there may be a step missing somewhere else, in regards to setting up the projection properly.

    Any help would be appreciated. Thanks.

    • http://www.vimeo.com/weluvmovies Brad

      After lots of guess work, I finally figured out what the issue was with my project. ***I can only confirm this is the solution with Maya 2011***

      To fix the problem with my image not aligning properly, I checked the projected image properties and chose to NOT to “match camera resolution”.

      This was the fix I needed for my image to line up properly. Also, FYI for any Newbies, make sure in your render settings you have turned OFF the “render selected objects only” or just remember to select your objects before you render… this will keep you from rendering nothing.

      @Daniel, Thanks a lot! This tutorial was enlightening, and even though it wasn’t exactly step by step for my version of Maya, I learned a lot about rendering and how the projections work. Really glad you took the time to post this… Thanks!

  • Daniel Amedoda

    Hi Brad/Chris

    Sorry for my delayed response. I have not checked this page in a while so I only just became aware of the troubles you where having with the steps. Brad, thanks for the advice as well I will look into it. If possible I would love to be able to answer your questions so if anybody has any thing they would like to ask please drop me and e-mail to Daniel@acreativemind.net in reference to ‘Camera Projection Mapping in Maya’.
    I would also love to see what you are have been able to create with the help of this tutorial, that way we can all inspire each other. :D

  • mikeEcu

    Awesome tutorial! Thanks, just what I was looking for. Plus thanks for the added bonus of explaining how to split up a render and composite it back into aftereffects!

    • Daniel Amedoda
      Author

      You are most welcome. I hope to do more like this soon.

  • Severo

    Is there a way you could provide the source image so if I was doing it step by step I can add the textures by your method? I’m a beginner at this so a source image for the textures would be awesome! >< Great stuff also!

  • Theiamania

    Hallo Daniel,
    great (and rare…) tutorial!
    But I’ve a problem in step 17: I’m a mac user and I utilize maya 2012 andi can’t find in CREATE REDER NODE PANEL any button like “Normal”, “As projection” or “As stencil” … ; therefore I can not go forward with tutorial: can you please help me?
    Many Thanks!

    • Kenn

      In Maya 2012, in the Create Render Node menu, go to Utilities and select Projection. Cheers

      • Kenn

        Scratch that, you can just right-click on File and you get the option to select Create as projection.

  • Swapnil

    Hello Daniel,

    Thank You,It’s very helpful for me,
    thank u once again………

  • Junkie76

    wow, thank you very much for this gem, you do not know what you have enlightened my
    mind, and not just for your job in itself …