View Full Version : Demystifying the dark arts of Camera mapping ...
03-07-2007, 01:45 AM
Camera mapping/projecting still gets me a little confused, and i'm sure many other people too. I know the basics but a few things continue to have me puzzled, so with that i'm going to try and demystify the dark art.
To begin with, please see pic:
Please forgive the mother of all crap illustrations :)
So we're looking down on two cameras, a patch of grass and a few buildings in a line. First questions is this; Notice where the number 1 is located. As the image is been projected through the 'pro cam' it projects along the FOV against the front of the buildings where the red line is. However when i come to position my 'ani cam' i will be revealing this area (1) that isn't within the projection field of view. In max it just tiles the other side over. Sooo, how do i solve this?
I guess one answer might be to use multiple projection cams, having another projector where the ani cam is currently sat. That said i'm sure there must be another way, something i'm missing. The above would mean you will always need a second projector if you move outside the FOV. (unless your pushing in slightly)
03-07-2007, 03:59 AM
camera mapping is still something i need to experiment more.But as for the question i simply paint more on the side thus extend the image.
03-07-2007, 09:23 AM
I have to agree with newmanhyde. You simply pull the proj cam a bit back and paint a larger mattepainting.
03-07-2007, 11:08 AM
in this thread (http://forums.cgsociety.org/showpost.php?p=4232763&postcount=6) joblh was asking about mulitiple cameras techninques...and he discovered this thread (http://www.mattepainting.org/forum/...t=patch&start=0) that pretty much explains patches and multiple cameras...
But yeah as you say it would be great to avoid multiple cameras...I d love to know tricks like that, too!
03-07-2007, 11:42 AM
Yep that makes sense.
So the general process is as follow:
1. create the matte painting
So from this point there's two directions we can take, from one point we can create a map painting in photoshop and take this into our 3d program (Max in my case) or we might have already created the matte painting in 3d, rendered out, over painted in photoshop then taken back into max. At this point it's worth noting that the matte painting should be larger than the target resolution as discussed in the first post above. So from which ever direction they take we open Max and start setting up the scene...
2. scene setup
First we set the resolution to whatever the final output is. Next right click on Perspective and select show safe frame to get the correct ratio.
Then we go into view>viewport background > click file and import the matte painting as the background. Click Match rendering output and display background before clicking ok. We should now have our matte painting in the background as a reference to build from.
Hit CTRL and C to create a new camera from the viewport, name this camera; Projector 1. Duplicate the camera and name it Animated Camera, move it to wherever you wish to begin your animation from, to the left in my above example and set key. Go to say 200 keys up the timeline, move the cam to a new position and set another key so the cam now animates between the two.
3. Building the scene
At this point we can start blocking in the basic features until we have a scene that closely matches our background painting.
So that's the basic setup to begin with.
4. setting up cameras
Next we want to project our painting onto the geometry.
Open the material editor select the first slot, click diffuse and select Camera Map Per Pixel. In here select the camera you wish to project from. In the texture slot click and locate the matte painting itself. So for the moment that's done. You may also wish to click the show Map in viewport. Move back up one to the default material, next select all geometry and apply the material. Click render and assuming we're looking through the projector cam we'll see the painting perfectly mapped over the scene. Go to the animated cam and click render and now we see the same shot though from a slightly different angle.
At this point problems will begin to arise. We might end up seeing outside the projected area, so silly me for not taking the above advice :) we need to move the animated camera in slightly to lose the edges.
Next depending on the extent of the camera move we will end up with stretching. Soooo...
This is the part where i start to get really confused ...
We now go to the point in the animation where the stretching occurs, duplicate the animated camera (removing any animated keys from it) and name this camera Projector 2.
Correct the distortion by whatever means...
and then ... well that's where i fall off the planet cause i just ain't got a clue.
Someone else please take over :-)
Do i make a completely seperate Cam per pixel map and apply the new painting into this one? I've heard people taking about masking and patching? how does this come in?
Hey Ziggy, didn't recognise you with the new avatar :-)
03-07-2007, 12:20 PM
yeah im getting confused at this part too, big time! I d love some proffesional feedback from James, perhaps :thumbsup:
hah i changed my avatar for the avatar wars over at DSF...will put back totoro soon as i don't really like this even though i spent 4 hours on it...:eek:
btw did u have a look at my wip (http://forums.cgsociety.org/showthread.php?f=196&t=462805&page=1&pp=15)?
03-07-2007, 01:00 PM
the easiest way is to just open the fov of the projection camera so that it covers the extra area that the animated camera sees.
just because your animated camera is set to an fov of 50 degrees doesn't mean that your projection camera can't be set to 120 degrees.
all you need to make sure is that you render your projection with enough resolution to support the fact that you anim camera is only seeing a smaller cropped in area of the main image.
when setting up your projection cameras you have to 'best fit' them to your scene. you do not necessarily use the first frame or the last frame but should decide which viewpoint will give you the best coverage of the whole shot.
patching is only needed when you have bleed through of your intial projection and wish to cover that up (i.e. the camera moves around a building revealing the projection for the front of the building on the back).
cheers, simon w.
03-07-2007, 01:12 PM
Cheers Simon, that's great. Can you expand on the process of patching?
Cheers - Dave.
03-07-2007, 01:33 PM
patching just refers to making another projection that covers over areas where your intial projection bleeds through the geometry. you control how the patch is applied using either polygon selections on your geometry or an alpha channel within the second projector.
i've never done this in maya or max as i'm a cinema 4d man but i've seen people using those apps doing this so i know it is possible there too.
cheers, simon w.
03-07-2007, 02:22 PM
thanks simon for the extensive info!!
03-07-2007, 08:49 PM
I've never done this in Max, so I'm not sure what you can and can't do, but I deal with this in Maya regularly.
An above suggestion was to pull the projection camera back, which is almost the right idea, but gives you new problems. as soon as you do that, the original projection doesn't line up, the perspective is wrong and if you zoom out (ie camera lens zoom) you'll once again have the wrong lens and wrong perspective.
In maya there is what is called "overscan", where your camera stays in the exact same place, same lens, but the field around is expanded. Say you do an overscan at 2 times the size. Then in your projection image, bring it into photoshop, increase the canvas size by 200% and now you have all that extra space to fill in missing areas.
This is a quick explanation, I should really sit down and do a real tutorial for some of this stuff.
03-07-2007, 09:07 PM
Yeh tutorials are good, you should do one ;-) You doing any mattes on Pirates 3?
So overscan, sounds good, but how can this be done in max? that's the question?
03-07-2007, 09:21 PM
overscan is doing a similar job to adjusting the fov wider.
i.e. if your camera is set to 25mm focal length at a resolution of 2048 pixels and you wish to render out at 2248 pixels just use 2048/2248=0.911, so 25mm*0.911=22.7mm.
set your new camera to 22.7mm and render at 2248 pixels and you have your exact original plus a hundred pixels left and right.
in the above example i can simply adjust my resolution as well if i wish (so instead of using 22.7mm focal length at 2248x1556 i can use 3372x2234, i get the extra info left and right but also much higher resolution so i can be more extreme with my camera move on my matte painting).
cheers, simon w.
03-07-2007, 10:05 PM
Hey Simon, you sure know your stuff :thumbsup: Any more tips you can share, pitfalls to avoid etc ..
Cheers again - Dave.
03-08-2007, 12:16 AM
You doing any mattes on Pirates 3?
doing some painting for it here and there, massive massive job though. You working on Pirates as well?
03-08-2007, 12:33 AM
No, sadly not :-) though who knows, Pirates 4 looks like it might get the go ahead, maybe then :-)
Are there a lot of camera mapping shots in P3? The stuff Chris Stoski did on 2 was great, i'm not sure how it can get any better :-)
Good look on that front.:thumbsup:
Cheers again - Dave.
03-08-2007, 02:23 AM
Hey guys, just pointing to a video tutorial by fellow CG man Mackdadd:
Basic mapping/camera move.
You can also see his thread at:
03-08-2007, 02:23 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2014, Jelsoft Enterprises Ltd.