Create a 3D Scene from a Photo in After Effects

Creating a fake 3D world from a still in After Effects is a very handy technique to know. Even if you never have to do this with a photo, you'll still want to understand how to set up this kind of faux 3D environment in After Effects to create depth using parallax. In this lesson Joey is going to break down everything you need to know to really sell the illusion of something being 3D in After Effects. 

Check out the resources tab for the photo that Joey used in this lesson. You'll also find a very handy article from Greyscalegorilla about different camera focal lengths that you'll want to check out. 

If you have any questions, click over to the Q&A tab to post them. Other students can answer you, and we'll put our team on the case to try and get you a solution ASAP.

If you have any questions, click over to the Q&A tab to post them. Other students can answer you, and we'll put our team on the case to try and get you a solution ASAP.

Download Project File

Click here for the photo used in this tutorial.

Camera focal lengths on Greyscalegorilla.

    00:00:00,283(mellow music)
    00:00:06,545(sound effects and beats)
    00:00:17,506- Hello.
    00:00:18,796Joey here at School of Motion and welcome today
    00:00:20,784for 30 Days of After Effects.
    00:00:23,384Today what we're going to talk about is taking a photograph
    00:00:26,064and turning it into a 3D scene inside of After Effects.
    00:00:29,554I'm sure a lot of you have done this before, but I'm going
    00:00:32,142to show you some tricks maybe you haven't seen yet.
    00:00:34,822How to really, really sell the illusion
    00:00:37,042that this is a 3D scene,
    00:00:38,612and how to make it look great and fool everybody.
    00:00:41,322Don't forget to sign up for a free student account
    00:00:43,083so you can grab the footage
    00:00:44,363and the project files from this lesson as well as assets
    00:00:46,993from any other lessons on School of Motion.
    00:00:49,353Now, let's hop into After Effects and get started.
    00:00:52,453So one of the things that I love about this technique
    00:00:54,433is that it's just kind of instant cool.
    00:00:57,793You take a still image,
    00:00:58,905you turn it into a 3D scene like this,
    00:01:02,705and it's not that hard to do, but it's really impressive.
    00:01:06,765If any of you are familiar
    00:01:07,964with the concept of matte painting,
    00:01:10,954which is used on feature films to kind of extend sets
    00:01:15,334and add castles to the background and stuff like that,
    00:01:19,434this is pretty much the technique that's used,
    00:01:21,439and you can do it in After Effects pretty effectively.
    00:01:24,809Now, I want you to notice that there's a few things
    00:01:27,383that I do when I do this type of thing
    00:01:30,023that I think makes it feel a little bit more natural
    00:01:33,324than sort of the simplified version of this.
    00:01:36,014The main thing that helps sell the shot is the ground.
    00:01:38,994If I scrub through this,
    00:01:40,080you can see that the ground is not...
    00:01:42,800It's not like this hill or these rocks
    00:01:44,972where it's just this flat image
    00:01:47,666that kind of looks like it's facing the camera.
    00:01:51,293It actually looks like it's oriented correctly
    00:01:53,617on the ground.
    00:01:55,489And there's a lot of blending going on
    00:01:58,559to make this feel as seamless as possible.
    00:02:01,349And then I also did some compositing tricks
    00:02:03,084and some other things
    00:02:04,012that maybe I'll show you a couple of those.
    00:02:05,852The main thing is: How do you set this scene up
    00:02:08,812so it really sells the effect, okay?
    00:02:11,844So you gotta start in Photoshop, so let's hop in there.
    00:02:15,424This is the original image I started with,
    00:02:17,452and I wont go through the process
    00:02:19,812of cutting everything out cause it takes a long time.
    00:02:22,042If you need help with that,
    00:02:22,909you should definitely check out...
    00:02:25,099There's a tutorial on my site called,
    00:02:27,089"how to cut out difficult images in Photoshop."
    00:02:30,149And that'll give you some good tips.
    00:02:31,619So, I'm gonna turn on this layer here
    00:02:33,646just so I can see these pieces
    00:02:36,336on a background that lets me focus on the edges.
    00:02:39,073So these are the three rocks that I cut out.
    00:02:42,173I want you to notice that I spent some time
    00:02:45,073to fix the edges after I cut them out.
    00:02:48,363A lot of times when you cut things out in Photoshop,
    00:02:50,583no matter how careful you are, you're gonna get edges
    00:02:54,303that have bright pixels or dark pixels.
    00:02:57,683These rocks are up against a sky,
    00:03:00,089so some of the pixels of these clouds would show through,
    00:03:03,549and I took the time to paint those out,
    00:03:05,909so that you wouldn't notice any of that
    00:03:08,109when you actually composite this thing.
    00:03:09,999I also want you to notice that down at the bottom of each
    00:03:12,109of these rocks, I feathered the edge of my layer mask
    00:03:16,724so that I could sort of blend the bottom
    00:03:19,354of the rock into the grass.
    00:03:21,950Alright, so that's the first thing,
    00:03:23,250just cutting out all the foreground elements.
    00:03:25,410So the next thing I need to do is create a clean plate,
    00:03:29,010and this is the clean plate that I created.
    00:03:32,278And all a clean plate is,
    00:03:33,747is just your shot without your subject in it.
    00:03:38,800So you have to use a few Photoshop tricks to get to this,
    00:03:43,387and I'll show you a quick one really fast
    00:03:45,592that I use all the time.
    00:03:46,892It's amazingly effective.
    00:03:48,532What I'm gonna do is,
    00:03:50,091I need to select all three of these rocks.
    00:03:52,251So, I'm gonna hold Command and I'm gonna click
    00:03:54,741on the Layer Mask for this layer
    00:03:57,522and you can see it made a selection there.
    00:03:59,264Then I'm gonna hold Shift + Command and click the other two.
    00:04:03,154So now I've got all three rocks selected,
    00:04:05,974and with those three rocks selected,
    00:04:07,625I'm gonna go up to Select...
    00:04:10,448Modify,
    00:04:11,448and I'm gonna expand my selection by two pixels.
    00:04:15,709And all I did was just kind of push
    00:04:17,408that selection out two pixels.
    00:04:18,924So now I've selected a little bit of the clouds behind it.
    00:04:24,404You know, a little bit of the background.
    00:04:25,769That's just gonna help me blend in
    00:04:27,421whatever patch I need to create.
    00:04:29,734Okay?
    00:04:30,954Now here's the magic part.
    00:04:32,514First let me make a copy of this.
    00:04:34,635It's always, always, always a good idea to keep a copy
    00:04:37,985of the original image in your Photoshop file.
    00:04:40,765That makes it a lot easier when you're in After Effects.
    00:04:43,185So well call this, Clean02.
    00:04:45,282And here's the trick,
    00:04:46,755you go up to Edit, Fill,
    00:04:48,705or you hit Shift + F5,
    00:04:51,060and you wanna make sure it says, "Content-Aware."
    00:04:53,582And this is one of those magic Photoshop features.
    00:04:56,232When I hit okay...
    00:04:59,082Done, right?
    00:04:59,915I hit Deselect, Command + D...
    00:05:02,103Look at what it's done for me?
    00:05:03,983Now, it's not perfect.
    00:05:04,853You can see that this is the ground,
    00:05:07,786and then all of a sudden it jumps up here.
    00:05:09,366That's not right, but that's easy to fix.
    00:05:11,436But the clouds are almost perfect.
    00:05:14,546There are some little things to fix.
    00:05:17,466So the next thing I would do is take five minutes,
    00:05:20,236and I usually start by hitting J
    00:05:23,028and using this healing brush,
    00:05:25,453which sort of automatically figures out
    00:05:27,393for you what to clone in there.
    00:05:30,302Okay?
    00:05:32,182Wherever you see little funky things like this,
    00:05:36,472you just paint over them.
    00:05:38,095And most of the time,
    00:05:39,214Photoshop can just kind of do the work for you.
    00:05:42,162I mean look how quickly that happened.
    00:05:43,820It's crazy.
    00:05:44,900Then what I would do is grab my Rubber Stamp,
    00:05:47,818with the S key,
    00:05:50,430and I would take the time to fix all this stuff,
    00:05:53,678and paint it back so it looks correct.
    00:05:56,274Okay?
    00:05:57,851But that's how fast you can make a clean plate in Photoshop.
    00:06:00,236It's pretty crazy.
    00:06:01,077Now, I also got rid of, I don't know
    00:06:02,491what the heck this thing is,
    00:06:03,821it looks like a dead animal,
    00:06:05,074and then there's like some pipes
    00:06:06,762or road or something over here that kind of drew my eye.
    00:06:11,082So I got rid of all that.
    00:06:12,148So here's my clean plate, and then I have the rocks.
    00:06:16,398The next thing that I did was, I took that clean plate
    00:06:19,378and I separated out the ground,
    00:06:22,639and I feathered the edge of the ground a little bit,
    00:06:25,400and then that hill.
    00:06:26,730Right?
    00:06:27,563And basically I was looking to separate out things
    00:06:30,430that are on different planes.
    00:06:32,230So that ground is one kind of plane.
    00:06:35,290It's facing straight up and down.
    00:06:37,400But then this hill is kind of at an angle.
    00:06:40,540And then the sky.
    00:06:42,500And if I turn the hill off, you'll see
    00:06:43,900I also extended the sky down here.
    00:06:46,830I did the same trick.
    00:06:48,570I actually cut the sky out,
    00:06:52,267and then I selected the hill,
    00:06:55,237and then I used that "Content-Aware" fill
    00:06:57,458and it painted in those clouds for me
    00:06:59,148and I cleaned it up and it took like a minute.
    00:07:01,378So those are all my layers.
    00:07:04,840I'll show you from the bottom up.
    00:07:05,894You got your sky, your ground, the hill,
    00:07:09,924and then you've got your three rocks, and that's it.
    00:07:11,917Okay?
    00:07:12,831So once you've prepped the Photoshop file,
    00:07:15,036then we go into After Effects.
    00:07:18,198So let's start a new scene here.
    00:07:21,846We'll call this, RocksScene.
    00:07:26,804And I imported the Photoshop file with all the layers,
    00:07:29,674and here it is.
    00:07:31,304So what I'm gonna do is, I don't need this clean layer,
    00:07:35,344but I do need the original, so I'm gonna copy
    00:07:37,364all of this stuff into my new scene.
    00:07:43,184And then I'm gonna parent everything
    00:07:46,834to the original for a minute.
    00:07:49,054Just so I can scale it up and position everything
    00:07:53,014so it's filling the frame.
    00:07:57,582Okay.
    00:07:58,552I just wanna set this up where I like the framing of it.
    00:08:03,912So that works for an initial framing.
    00:08:06,839Now here's the thing with this technique,
    00:08:08,779you kind of have to decide ahead of time...
    00:08:14,012What kind of camera you wanna use.
    00:08:17,176If you don't know a lot about different focal lens
    00:08:20,886and why you might use one over the other,
    00:08:23,506Nick Campbell over at Greyscalegorilla just did
    00:08:25,230an excellent tutorial for Cinema 4D about that topic,
    00:08:28,063so I'll link to it in the notes for this tutorial.
    00:08:31,413But in general, what I usually do with images like this
    00:08:35,347where I'm not gonna move the camera too much,
    00:08:36,807is I'll use a 50mm lens on an After Effects camera
    00:08:41,187and I will tell you why in a minute.
    00:08:42,662But...
    00:08:43,802If you're going to do a wide-angle lens, like a 25mm
    00:08:48,823or 15mm lens, to get some crazy effect, you need to add
    00:08:52,233that camera before you start setting the scene up.
    00:08:56,033Otherwise, it won't look right, so that's just something
    00:08:57,763you need to be made aware of.
    00:08:59,183So what I'm gonna is unparent all these things
    00:09:02,135from the original cause I don't need them parented anymore.
    00:09:07,165And I'm gonna turn my original layer on,
    00:09:09,885but I'm gonna set the mode to Difference.
    00:09:13,639You'll see the whole scene turns black
    00:09:15,892and this may not make sense now,
    00:09:18,262but what the Difference mode does, is that it looks
    00:09:22,012for pixels that are the same and it turns them black.
    00:09:26,742And then the brighter the pixel,
    00:09:29,459the more difference it's detecting.
    00:09:31,979So you can see that all the edges
    00:09:33,904of all the layers I cut out
    00:09:35,104are slightly different than the original image,
    00:09:37,244but for the most part, everything's identical.
    00:09:40,088We're just gonna leave this up here
    00:09:41,398and turn it on and off occasionally
    00:09:43,218to check that our 3D scene matches the original photo.
    00:09:47,218This is really neat easy way
    00:09:49,081to make sure that that's happening.
    00:09:51,801So step 1, let's first position the ground.
    00:09:56,754Okay?
    00:09:57,664So I'm gonna turn all of these layers into 3D layers.
    00:10:03,774Now the reason we're seeing this weird kind of three quarter
    00:10:06,268view here is because my camera's set to Custom View.
    00:10:09,302Let's go back to Active Camera.
    00:10:10,832When I'm doing this, a lot of times I like to switch
    00:10:12,835between Active Camera, which is your comp camera,
    00:10:16,585and this Custom View because with the Custom View,
    00:10:19,605if you hit the C key, it brings up your camera tool,
    00:10:21,585you can kind of move around it
    00:10:23,465and check the 3Dness of your scene.
    00:10:26,855So we're gonna jump back and forth between this view
    00:10:29,245and your Active View, and the hotkey for that is Escape.
    00:10:32,615Really simple.
    00:10:34,385So the ground...
    00:10:36,599The first thing I wanna do is I need to make the ground
    00:10:39,842actually oriented like a ground.
    00:10:41,822If we look at this custom view,
    00:10:42,893right now the ground is this flat plane,
    00:10:45,104and that is not the way a ground works.
    00:10:47,824So what I'm gonna do is grab
    00:10:49,444my anchor point tool, which is the Y key.
    00:10:52,904I'm gonna move the anchor point
    00:10:54,454to the horizon line, like that.
    00:10:57,084Then I'm gonna rotate, and let me go to my Custom View
    00:11:00,174so you can see exactly what I'm doing here.
    00:11:02,415I'm gonna rotate this on the X rotation,
    00:11:06,312and I'm gonna rotate it negative 90 degrees.
    00:11:09,702So now what I'm doing is setting up my floor of my scene
    00:11:14,922so that it actually is oriented like a floor, and this is
    00:11:17,245what's gonna let you get that awesome perspective
    00:11:19,825when you move the camera over the ground.
    00:11:22,515Now here's the problem with this:
    00:11:23,423if we go back to our Normal view,
    00:11:25,465you can see that now the ground doesn't look right.
    00:11:28,167It's squashed visually because we've rotated it.
    00:11:31,587So now you have to kind of correct for this.
    00:11:34,227So what you do is,
    00:11:35,885first scale that layer, and I'm gonna scale it on Y
    00:11:41,472so that I can bring it back to the bottom of the frame.
    00:11:45,322And if we look at our Custom view,
    00:11:46,632you can see what that's doing.
    00:11:47,662It's kind of unstretching the image.
    00:11:51,941Okay?
    00:11:53,361So what you wanna is bring that just
    00:11:55,501until it hits the bottom of the frame.
    00:11:58,181Now let's turn on this original image for a minute.
    00:12:01,968And you can see, now ignore all this stuff up here,
    00:12:04,228but you can see that the grass does not match very well.
    00:12:06,358There's a lot of image showing,
    00:12:08,848and when it matches perfectly,
    00:12:10,468it's gonna be all black pixels.
    00:12:11,918When it doesn't match that well,
    00:12:13,138you're gonna see a lot of stuff,
    00:12:14,908and that's what we're seeing.
    00:12:16,238The reason for that is because
    00:12:19,538by rotating this and scaling it,
    00:12:22,518we're introducing perspective.
    00:12:24,578You see how the ground layer actually comes all the way
    00:12:27,908out here and all the way out here.
    00:12:30,048So there's image over here that we can't see,
    00:12:33,348and even just visually looking at it, it looks stretched.
    00:12:35,928It doesn't look right.
    00:12:37,648The way to fix this is actually pretty easy.
    00:12:40,788What you do is,
    00:12:42,401you add a Corner Pin effect.
    00:12:45,096So we're gonna go to the Distort menu,
    00:12:47,176and you can use the Corner Pin.
    00:12:49,156I like to use the CC Power Pin
    00:12:52,806because it gives you this nice guide here.
    00:12:56,426And what you wanna do is take the corners
    00:12:59,006that our outside of the image and just pull them back over.
    00:13:02,316And you can hold Shift and it'll lock it vertically
    00:13:08,166so you'll only moving it horizontally.
    00:13:09,779And you move this back,
    00:13:11,768and you can kind of see that the plug in gives you a clue
    00:13:15,325when you've got it back to perpendicular orientation here.
    00:13:20,030Okay?
    00:13:21,151Cool, so let's take a look at that now.
    00:13:22,524So now our ground layer
    00:13:24,746visually matches pretty closely to this.
    00:13:28,006Now it's still now exact, and if you want to,
    00:13:31,439you can mess with the scale and try to nudge things around.
    00:13:35,259But it's matching pretty well.
    00:13:37,079And here's what's really happening...
    00:13:39,202If I hit escape, and we go to the Custom view,
    00:13:41,727it looks very strange from this view, right?
    00:13:44,615But the key to this trick is that it doesn't matter
    00:13:46,422what it looks like from this view.
    00:13:48,866It matters what it looks like from where that camera is,
    00:13:51,646and you can see, as I line this back up,
    00:13:56,842and I hit C a couple of times,
    00:13:57,915I can use different camera tools like the Zoom tool,
    00:14:00,445and you can see that now if I zoom in,
    00:14:03,445the ground actually moves and behaves like the ground.
    00:14:07,779It looks correct,
    00:14:09,250and I get that nice parallax when we're moving.
    00:14:13,070So that's probably the biggest trick,
    00:14:15,120and a lot of you can probably turn the tutorial
    00:14:17,233off right now because now you know how to do that.
    00:14:20,443And just to check it, I'm gonna add a camera to the scene,
    00:14:24,299and I'm gonna leave it as the default, which is 50mm.
    00:14:28,071If it's not 50mm on your After Effects, just click here
    00:14:31,052and switch it to 50 and you're good to go.
    00:14:33,582So then what I can do is to just check it,
    00:14:36,952I can just scoot the camera forward and backwards on Z,
    00:14:40,992and you can see that that ground
    00:14:42,542really does move like the real ground now.
    00:14:46,806So that's step 1.
    00:14:48,106Step 2 is gonna be
    00:14:50,132to start positioning everything else.
    00:14:53,202So let's do the hill.
    00:14:55,432So if we hit Escape and look at this,
    00:14:57,895this is where this view really comes in handy
    00:14:59,625because you can actually get a good sense
    00:15:02,215of where that hill is and where the rocks are gonna go
    00:15:04,965and make sure everything looks right.
    00:15:06,445So what I'm gonna do is switch back here.
    00:15:08,575I'm gonna set the anchor point of the hill
    00:15:11,454to be the bottom of the hill.
    00:15:14,617So I hit Y to bring up my anchor point tool.
    00:15:17,097Grab the anchor point, move it down here.
    00:15:20,037And I'm gonna parent it to the ground like this.
    00:15:24,037And the reason I'm gonna do that is
    00:15:25,257because now I can zero out..
    00:15:29,817Now this is gonna seem weird.
    00:15:31,336If I change the Z position of the hill,
    00:15:34,721it moves up and down, which doesn't really make sense
    00:15:37,605because it looks like this is the Y axis
    00:15:41,775So shouldn't I be adjusting the Y axis?
    00:15:43,985Well, what's happening is
    00:15:45,336because it's parented to the ground,
    00:15:47,986these coordinates are being shown relative to the ground.
    00:15:53,329And the ground has been rotated 90 degrees, so...
    00:15:58,917The Y axis on the ground
    00:16:02,637doesn't line up with the Y axis on the hill anymore.
    00:16:05,167So just be careful of that when you have stuff parented.
    00:16:07,397But what I wanna do is zero out the Z on the hill.
    00:16:12,188And that just makes sure
    00:16:13,788that the hill is connected to the ground.
    00:16:19,168Because if you're not careful...
    00:16:23,481If the hill is like, down here or something,
    00:16:26,661but then you compensate for that by moving it on Y...
    00:16:30,132Let me turn the sky off for a minute.
    00:16:33,029Visually, it can look correct,
    00:16:34,224but when the camera starts moving,
    00:16:36,484you're gonna get a gap there.
    00:16:38,944So you always wanna make sure you have your scenes set up
    00:16:42,274so it's physically correct.
    00:16:44,844So I want that hill to be,
    00:16:48,268like this. Right?
    00:16:49,630Literally flushed with the ground.
    00:16:52,230There's a little bit of a gap there.
    00:16:54,260You can see that this feathered edge of the ground,
    00:16:58,253it kind of creates this gap.
    00:17:00,933If that becomes a problem, I would just cheat
    00:17:03,490this hill forward a little bit, like this.
    00:17:07,210But we'll see if that's actually gonna be a problem.
    00:17:09,530Let me turn the sky off for a minute
    00:17:10,670because the same trick I did with the ground,
    00:17:13,760I wanna do with the hill.
    00:17:15,480This hill, if I look at it,
    00:17:16,752right now it's just sticking straight up in the air,
    00:17:20,002but that hill is really not sticking straight up in the air,
    00:17:22,072it's got more like a gentle slope to it.
    00:17:25,172So what I'm gonna do is come to this view and rotate it
    00:17:28,765on the X axis,
    00:17:31,317and just kind of bend it backwards a little bit,
    00:17:35,437until it seems appropriate.
    00:17:38,929That might be a little too far,
    00:17:41,515but let's just try fixing it a little bit.
    00:17:44,329So that feels pretty good,
    00:17:45,886but now we're gonna have the same problem.
    00:17:48,916We've now distorted the image,
    00:17:50,566and you need to use a Corner Pin effect to fix that.
    00:17:55,486So here's the trick that I've found.
    00:17:58,433Let me first show you what happens
    00:18:00,075if you add the Corner Pin effect,
    00:18:02,455and I try to grab these top corners
    00:18:04,955and move them back like this.
    00:18:07,665You see what happens?
    00:18:08,515It undistorts, but it actually moves the image down
    00:18:11,275and now we've kind of screwed something up.
    00:18:13,795So let me reset this and turn this effect off for a minute.
    00:18:18,065What I need to do is first,
    00:18:21,169zero out the rotation on the hill.
    00:18:24,996Make sure that you can see your rulers.
    00:18:26,906If you don't see them, it's Command + R, reveals them
    00:18:29,641And I'm gonna drag a guide to the top of my layer.
    00:18:33,961You see where the top is right here?
    00:18:36,501I'm gonna drag a guide there, and then just in case,
    00:18:40,811I'll drag one to the bottom too.
    00:18:43,361So now, I'm gonna rotate this,
    00:18:45,186and I think it was 25 degrees.
    00:18:50,146Or was it negative 25 degrees?
    00:18:51,506It was negative 25 degrees.
    00:18:53,749Negative 25 degrees.
    00:18:57,499And then, turn my Power Pin on.
    00:19:00,339And now what I wanna do is,
    00:19:04,041move my corner pin
    00:19:06,196so that I've got a perpendicular line here
    00:19:09,446and then move it up so it's on that guide.
    00:19:13,336If you do it this way,
    00:19:16,976and then move these corner pins as well to this guide.
    00:19:21,206There we go.
    00:19:22,736And you can see now you've undistorted the image,
    00:19:26,656and it's much, much closer to the original.
    00:19:28,676You'll never gonna get it perfect with this technique
    00:19:30,876because you're kind of cheating by using the corner pin,
    00:19:34,676but it's pretty close.
    00:19:36,106And then you can just come into your Custom view
    00:19:38,086and take a look at what's actually going on.
    00:19:41,096And I can also see that I've stretched that hill out...
    00:19:44,689horizontally.
    00:19:45,522So what I'm gonna do is scale that back this way, like that.
    00:19:49,818And then I'm just gonna move it.
    00:19:51,568I'm gonna cheat the whole thing
    00:19:52,401a little bit closer, like that.
    00:19:55,448And then let's look through the camera.
    00:19:59,978And I'm gonna move it down just a little bit...
    00:20:05,428Looks pretty good.
    00:20:09,568Alright, I'm just kind of nudging it around
    00:20:10,959until it looks right, and if you wanna check it,
    00:20:12,694you can turn on your original image,
    00:20:16,725and get the Difference matte, and you can see
    00:20:17,854that there's tons of black where that hill is,
    00:20:21,234so we know that it's actually lined up pretty good.
    00:20:25,154And now if we move the camera,
    00:20:26,774you can see that you've got that hill back there.
    00:20:28,827It's got a little bit of a slant to it.
    00:20:31,437The ground moves like the ground, but the hill moves
    00:20:33,477like something that's kind of sticking up in the air.
    00:20:37,160Cool?
    00:20:37,993So essentially what we're doing,
    00:20:40,830you can do this is Cinema 4D using camera projections,
    00:20:44,110we're basically faking a camera projection.
    00:20:46,350We're undistorting the perspective that's inherent
    00:20:49,715in the image by stretching out the layer
    00:20:52,505and corner pinning it in a way to undistort it.
    00:20:55,815Okay?
    00:20:56,648So now we've got the ground.
    00:20:58,985Now, let's do the rocks.
    00:21:01,295So, we're gonna, one at a time,
    00:21:06,115and actually let me turn off the ground for a minute,
    00:21:08,345and I wanna make sure that the anchor point
    00:21:11,345of each of these rocks is at the bottom of the rock.
    00:21:16,745And then, there's two, and there's three,
    00:21:20,805and then I'm doing this
    00:21:22,920the same reason we did it for the hill.
    00:21:26,270Because now I can parent those rocks to the ground,
    00:21:30,220open the position and zero out their Z,
    00:21:33,930and now I know all three of them are on the ground.
    00:21:38,633Okay?
    00:21:40,723So let's turn the ground and the hill back on.
    00:21:42,483And this won't look right.
    00:21:43,423Don't worry about it yet.
    00:21:45,043If we look at our 3D view,
    00:21:46,167you can see that the rocks are not positioned correctly.
    00:21:51,157So what I'm gonna do is use this view
    00:21:54,027to figure out where in Z these rocks need to go.
    00:21:59,787So if grab the Z axis of this rock, I can pull it forward,
    00:22:04,587and what I can see is that right here on the ground,
    00:22:08,327this is the shadow of that rock,
    00:22:10,627so I think that's around the position it needs to be on Z.
    00:22:14,607And then rock two, it looks like the shadow's
    00:22:17,394probably around there, so let's put it there.
    00:22:21,714And then for three, it's right about there.
    00:22:25,684So that to me looks like the correct relative position
    00:22:29,274of these rocks,
    00:22:30,965and then I'm gonna go into my normal active camera view,
    00:22:36,540and now I need to scale these things down
    00:22:38,470and line them up with the original image.
    00:22:40,860So, rock one is obviously way too big,
    00:22:43,000so let's scale it down,
    00:22:45,820and let's move it over cause it's not in the right spot.
    00:22:48,450And let's turn on that original image.
    00:22:50,280And this is where it gets really, really, really handy.
    00:22:53,641Because now what I can do is leave that on
    00:22:56,011and I can scale my rock up and move it over
    00:23:00,862and I can really quickly see
    00:23:03,972if I'm matching the original image or not.
    00:23:06,632And if I need to move it down a little bit
    00:23:09,088to cheat it, I'll do that.
    00:23:11,278I'm just gonna get it as close as I can.
    00:23:14,068It doesn't have to be perfect,
    00:23:15,072but the closer it is, the better.
    00:23:17,852So that one's lined up pretty good.
    00:23:19,612So now we'll do rock two.
    00:23:21,472Rock two is too big, so let's scale it down.
    00:23:24,952Let's scoot it over.
    00:23:28,082That's not bad.
    00:23:30,292Then we'll do the third one.
    00:23:33,342And scale it down and scoot it over.
    00:23:37,722Cool. Now let's turn off the original.
    00:23:39,950Ok, cool.
    00:23:40,783So now if we move the camera back and forth,
    00:23:44,771you can see that we're getting parallax
    00:23:47,911and we have a pretty good 3D setup.
    00:23:52,751Now one thing, it's not a terrible thing
    00:23:55,521and you may not even notice it,
    00:23:56,651but look at the edge of this rock.
    00:23:59,711See how there's a hard edge down there?
    00:24:02,281What's happening is this:
    00:24:03,411If I solo rock one, you can see that I've got
    00:24:05,488this nice feathered kind of bottom to the rock.
    00:24:08,467The problem is,
    00:24:11,138this is sort of extending down
    00:24:14,288past the anchor point a little bit.
    00:24:16,468So here's the anchor point,
    00:24:17,454that's actually where that rock is attached to the ground,
    00:24:20,413but what happens is that when this layer
    00:24:22,531intersects the ground, it creates this hard edge,
    00:24:26,641like that.
    00:24:28,041So I want this rock to sit right there,
    00:24:33,521but I also still want to see all of that extra stuff
    00:24:38,381that's down there to kind of help feather it
    00:24:40,537into the ground, if that makes sense.
    00:24:43,007And if we look through this camera view,
    00:24:46,037you can see that if I come down here,
    00:24:49,012that part of that rock layer
    00:24:50,410is sticking out underneath the ground.
    00:24:52,088Well I wanna see that stuff,
    00:24:54,628but I still want this to be correct in 3D space.
    00:24:57,738So what I basically want to do is cheat,
    00:25:00,608and there's a really cool way to do this.
    00:25:03,498What I'm gonna do is, I basically want these three rocks
    00:25:06,888to be exactly where they are in space, but no matter what,
    00:25:10,438I do not want them to intersect the ground.
    00:25:13,218And the way you do it is you insert an adjustment layer
    00:25:17,258between these layers and these layers.
    00:25:21,788So I'm just gonna add a layer, and the way I normally name
    00:25:24,053these is just put a bunch of dashes, like this,
    00:25:27,153and that way it's just a nice visual separator.
    00:25:29,563I can tell where my adjustment layer is.
    00:25:32,713So now watch as I turn this on and off.
    00:25:35,433When it's off, you get those hard edges.
    00:25:37,943When it's on, it brings back all of that detail,
    00:25:42,133but I still get the full 3D effect.
    00:25:48,385And it's not perfectly correct,
    00:25:50,031but it does really help blend
    00:25:52,202those rocks into the ground now.
    00:25:56,352And if we look through this, you're not gonna see the effect
    00:25:59,371of the adjustment layer, but you can really see
    00:26:02,161that we're starting to build out
    00:26:03,330a 3D scene that makes sense.
    00:26:06,580So then the last thing we need to do is deal with the sky.
    00:26:11,130So the sky, if we look right now,
    00:26:14,121is really right at the edge of the hill
    00:26:17,666and that's not where the sky is.
    00:26:19,326The sky is actually very far away.
    00:26:21,756So I'm gonna just push the sky back in Z space
    00:26:25,398a really good amount, like maybe 15,000,
    00:26:29,956like really far away.
    00:26:31,626Then I'm gonna scale it way, way back up,
    00:26:37,386and I'm gonna turn on my original image here.
    00:26:41,446Actually you can see I kind of did a good job.
    00:26:43,666See if I'd made too small,
    00:26:45,654as I scale it up,
    00:26:48,189right about there...
    00:26:49,649See how it almost turns the whole image black there?
    00:26:53,514That lets me know that the sky is now scaled
    00:26:55,844and it's back in its right place.
    00:26:57,074So let's turn this off.
    00:26:59,284By the way, I want to point out:
    00:27:00,542You see how the rocks are no longer lined up with the image?
    00:27:02,582That's because I've moved the camera a little bit.
    00:27:04,786If I move the camera back to the default position,
    00:27:07,476it all aligns back up.
    00:27:09,336So let's turn that off.
    00:27:11,916So now if we move this, you can see that the sky does move,
    00:27:15,096just not very much, which is what you want.
    00:27:17,176And the last thing I do is,
    00:27:18,921I like to put a little bit of perspective on the sky
    00:27:21,451because again, the sky is not just a big flat...
    00:27:26,552Thing. Right?
    00:27:27,394It's actually above your head
    00:27:29,834and going back into the horizon.
    00:27:31,944So what I'm gonna do is change the anchor point of the sky
    00:27:36,854somewhere around here, and you can see that just by luck,
    00:27:41,014these guides that I used on the hill layer
    00:27:45,116work for the sky layer.
    00:27:48,886So what I'm gonna do is rotate that sky layer on X
    00:27:52,816and have it rotate backwards maybe 45 degrees or something.
    00:27:58,906And then I'm gonna use that Power Pin trick.
    00:28:02,366So I'm gonna move
    00:28:05,274the corner pins
    00:28:07,240to undistort this.
    00:28:08,687I'm using the guides to make my life easier,
    00:28:12,351and there you go.
    00:28:13,381So now that sky is back undistorted,
    00:28:16,261but if we look through our 3D camera view, you can see
    00:28:18,631that it's actually got a little bit of an angle to it.
    00:28:23,761So you're gonna get a little bit of a perspective shift
    00:28:26,821as this camera moves.
    00:28:29,471Just a little bit, alright?
    00:28:30,521It's super subtle.
    00:28:33,201And that's kind of it,
    00:28:34,034as far as the basics of setting the scene up.
    00:28:36,359The rest of it is making a convincing camera move and doing
    00:28:40,283some compositing, so I'll give you a few quick tips on that.
    00:28:45,217What I did for my camera move, I did this just very simply.
    00:28:50,427It's moving on Z, and I'm also rotating the camera
    00:28:54,424a little bit on the X axis
    00:28:56,831just to make sure it's always looking at the same place.
    00:28:59,661Like if I want the hill to always
    00:29:01,886be right about there in the frame,
    00:29:04,456then I put a key frame there.
    00:29:06,958Let's go forward maybe 5 seconds,
    00:29:09,318and let's push the camera forward a little bit
    00:29:11,858right to there,
    00:29:13,412and as it's moving forward, have it rotate down like this,
    00:29:16,602so that way it's kind of always orienting the same way.
    00:29:22,002And you can see, here we go, we got our nice 3D scene.
    00:29:25,292It looks great.
    00:29:26,892The ground is moving like the ground.
    00:29:29,352So from here, it's just a matter of compositing it
    00:29:32,462so it doesn't look so still and synthetic.
    00:29:36,082I'll show you guys a couple of tricks.
    00:29:37,732I did some color correction and I added some glows
    00:29:41,622and stuff like that to kind of make it look
    00:29:43,652a little bit more like gladiator or something.
    00:29:47,392But a really simple trick...
    00:29:50,886let's come back here,
    00:29:52,316is add an adjustment layer
    00:29:56,036and use...
    00:29:59,768an Optics Compensation effect.
    00:30:01,678It's in the Distort group, Optics Compensation.
    00:30:04,778And it basically just simulates lens distortion.
    00:30:08,058So if you turn on Reverse Lens Distortion,
    00:30:11,468you can see that it kind of simulates
    00:30:13,898having a little bit of a wide angle lens
    00:30:16,678where the edges of the frame move faster
    00:30:21,228than things in the center of the frame.
    00:30:23,072And it's a subtle thing and you can really easy over-do it,
    00:30:26,733but if you look at the edges, especially with this rock
    00:30:29,105when it gets towards the edge of the frame,
    00:30:30,565it gives it a little bit of a 3D look.
    00:30:34,435It just helps it a little bit.
    00:30:36,365The other thing that I did was put a little bit of a wiggle
    00:30:39,515on the camera just to make it feel a little bit less perfect
    00:30:43,945cause camera moves in After Effects by default are just
    00:30:47,335perfectly smooth when your camera moves, and we're kind of
    00:30:50,945pretending that there are some dolly tracks
    00:30:53,145and we're doing a nice dolly move here.
    00:30:54,955Well if dolly tracks are happening over uneven lumpy grass,
    00:30:59,095then it's not gonna be a perfect move.
    00:31:02,113So what I might do is make a Null,
    00:31:06,043and call this the Wiggle null.
    00:31:09,013And on the position of that Wiggle,
    00:31:10,772and this needs to be a 3D layer,
    00:31:14,032I would just Option + click position and type in a Wiggle
    00:31:17,094expression, and maybe it wiggles once a second by two units.
    00:31:23,682And now I can parent the camera to that null.
    00:31:27,244And it's just gonna do
    00:31:28,077a subtle, subtle, subtle, subtle little wiggle.
    00:31:30,173Alight?
    00:31:31,493Let me RAM preview this one to one here.
    00:31:34,793So we're still getting the same basic move,
    00:31:37,013but it's just not as perfect
    00:31:39,213and it kind of helps sell it a little bit.
    00:31:44,238And then I did some color correction.
    00:31:47,721I'll show you guys a cool trick really fast.
    00:31:51,478Cause this something that sort of helps.
    00:31:55,958Whenever I do stuff like this, I stare at it a lot
    00:31:58,508And I kind of go back and forth and I say...
    00:32:01,352There's something about this that's giving it away.
    00:32:04,552It just doesn't look totally natural.
    00:32:07,292It just doesn't look real.
    00:32:09,452Especially if you go into full res and we zoom in here.
    00:32:12,145The edges of the rocks are just too hard.
    00:32:19,214Normally you would see a little bit of the sky
    00:32:21,123kind of wrapping around and lighting the back
    00:32:23,943of these rocks a little bit.
    00:32:26,003And we're not really getting that because I cut them out
    00:32:28,653in Photoshop and the edges are just too crisp.
    00:32:31,563So what I did was, it was actually kind of a pain.
    00:32:35,618I wanted to be able to independently work on
    00:32:38,898just the foreground stuff, like the rocks and grass,
    00:32:42,298but not affect the sky.
    00:32:46,898And this is one of the reasons I love nukes so much.
    00:32:51,038It's really easy to do that.
    00:32:52,438In After Effects, you have to jump through a few hoops.
    00:32:55,598So what you can just do is this:
    00:32:57,708This is rocks scene.
    00:32:59,368I'm gonna rename this comp, Rocks Scene Foreground,
    00:33:02,561and I'm gonna turn off the sky,
    00:33:05,645and then I'm gonna duplicate it,
    00:33:07,520and I'm gonna say, Rocks Scene Background.
    00:33:11,397And I'm gonna turn the sky back on,
    00:33:13,577but turn off everything else.
    00:33:16,637Then I'm gonna bring both of these into a new comp.
    00:33:20,217Say create a "Single Composition,"
    00:33:22,647and the background should be behind the foreground.
    00:33:25,527So now, I've got my same camera move,
    00:33:28,918but I can independently affect
    00:33:33,089just the background or the foreground.
    00:33:35,819So what I want to do is blur the edges
    00:33:38,909of the foreground just a little bit.
    00:33:41,529So an easy way to do that is to use a Channel Blur.
    00:33:44,397So we go to Effect, Blur, Channel Blur, right there.
    00:33:50,490And I'm just gonna blur the alpha channel,
    00:33:52,470and you can see what that does.
    00:33:54,620I just wanna blur it by one pixel
    00:33:58,107and say Repeat Edge Pixels so that on the edge of your comp
    00:34:01,540you don't get this little funky line here.
    00:34:04,510So make sure you have that checked.
    00:34:07,830And if I turn this on and off,
    00:34:09,311you'll see that it's just super subtle,
    00:34:12,521but I'm telling you, all those things they do help.
    00:34:19,404Let me make sure I can see this whole thing.
    00:34:21,192So now I've got an Edge Blur on there.
    00:34:24,672And then for the next step,
    00:34:26,132I wanna add a little bit of a light wrap to this. Okay?
    00:34:31,522You can get light wrap effects for After Effects,
    00:34:37,302and that's a cool way to do it.
    00:34:38,342There's actually a pretty simple way
    00:34:39,832I'll show you just using built in effects,
    00:34:42,080where you can get really great light wrapping
    00:34:43,340and really control it.
    00:34:45,120So what I'm gonna do is first is precomp this again
    00:34:48,190And the reason I have to precomp it is
    00:34:49,800because I have a channel blur on this comp,
    00:34:53,540and I'm gonna need to use this foreground as a matte
    00:34:57,090to make my light wrap.
    00:34:58,693And if I do that, and I have this effect on it,
    00:35:02,306it won't actually use this effect
    00:35:04,184when it calculates the matte.
    00:35:05,794I'm not sure that makes a lotta sense, just trust me.
    00:35:09,160To do what I'm about to do,
    00:35:10,766you cannot have any effects on your precomp.
    00:35:14,446So let's just precomp it,
    00:35:15,555say "move all attributes into the new composition,"
    00:35:18,425and this will be Rocks Scene Foreground Blurred.
    00:35:22,825There we go.
    00:35:24,055Okay, cool, so now we got that.
    00:35:26,213What I'm gonna do is duplicate my background layer,
    00:35:29,305and I'm gonna call this, Light Wrap.
    00:35:33,742Okay, and I'm gonna move it on top of my foreground.
    00:35:36,712Next thing I'm gonna do is use an effect
    00:35:39,672in the Channel group called, Set Matte.
    00:35:41,614And this effect is awesome.
    00:35:43,244I use it a lot.
    00:35:44,184And it just lets you use another layer's alpha channel
    00:35:47,794instead of your current layer.
    00:35:49,664So I'm gonna say take the map from the layer
    00:35:51,972called Foreground Blurred.
    00:35:55,280And now if I solo this layer, you can see what it did.
    00:35:58,260This is my background layer,
    00:35:59,812remember it's a copy of my background,
    00:36:01,557but I'm using foreground as the alpha channel.
    00:36:04,278I'm gonna say, "Invert Matte."
    00:36:07,068Then, I'm going to blur this image,
    00:36:09,848so I'm just gonna use a Fast Blur,
    00:36:12,462with Repeat Edge Pixels on,
    00:36:13,792and I'm gonna blur it...
    00:36:16,73230 pixels.
    00:36:19,017And just to sort of give you a sneak preview,
    00:36:20,967you can see now
    00:36:21,800if you look at the edges of your rock,
    00:36:25,624you can see that it's now letting
    00:36:27,081that sky bleed over it a little bit,
    00:36:29,391and this works better if you set the mode
    00:36:31,535to something like Add
    00:36:32,845so it looks almost like,
    00:36:34,404you're just getting some of the light
    00:36:36,004from the clouds bouncing off and hitting that rock.
    00:36:38,864And you can adjust the opacity of it, but it sort of
    00:36:40,694lights the rocks from behind and the back of the hill.
    00:36:45,414The problem is that you're seeing this blurred sky
    00:36:48,194and you don't want that.
    00:36:49,454What you now want is to...
    00:36:53,187Cut out this layer here, this light wrap scene,
    00:36:57,069so you only see it within the foreground.
    00:37:00,569The way you do that is easy.
    00:37:01,639You duplicate the Set Matte effect, move it after the blur,
    00:37:05,899and then uncheck Invert, and there you go.
    00:37:08,609So now you've created your own light wrap.
    00:37:12,789Alright, turn it on and off,
    00:37:13,889and you can see it's very easy to overdo the light wrap too.
    00:37:18,889So you may want to play with the blur.
    00:37:20,739If you blur it too much,
    00:37:21,709you get this really kind of glowy look which can be cool.
    00:37:27,349And then you can adjust the opacity.
    00:37:29,479And I'll show you one other trick too
    00:37:31,659which I just sort of figured out,
    00:37:33,780which works pretty well and I think it's pretty slick.
    00:37:38,200One of the things that kind of stinks
    00:37:40,107about doing it this way, is the light wrap
    00:37:42,007gets applied uniformly to every piece of this.
    00:37:48,977You could mask that out
    00:37:51,286or create an alpha matte layer for it,
    00:37:54,166but because the camera's moving, you'd have to animate
    00:37:55,527the mask and it'd be kind of a pain.
    00:37:58,246So I was thinking, it'd be cool
    00:38:00,216if the light wrap was only hitting the right side
    00:38:04,317of these rocks.
    00:38:05,577Because if you look, the light seems
    00:38:07,414to be coming from that side.
    00:38:09,104The left side of the rocks is darker.
    00:38:11,174So what I did was I duplicated my foreground layer,
    00:38:15,529and let's call this,
    00:38:17,895Light Wrap Matte,
    00:38:22,805and let's solo this.
    00:38:24,465And what I did was I used an effect.
    00:38:26,905It's in the Perspective group, and I normally
    00:38:29,815never use this, called Bevel Alpha.
    00:38:34,495And what it does is just creates
    00:38:36,530this cheesy-like Photoshop beveled layer look.
    00:38:45,880See how it basically creates white on this edge
    00:38:48,009and black on this edges?
    00:38:48,918I thought, "maybe there's a way I can use this as a matte."
    00:38:52,741So what did was, I also added an effect
    00:38:55,141in the Generate group called Fill.
    00:38:58,001And make sure Bevel Alpha comes after Fill.
    00:39:00,461And set that fill color to black.
    00:39:03,481And look what you get here?
    00:39:04,981You actually get a black and white image
    00:39:08,832where you can sort of control
    00:39:10,146which edge gets white and which one gets black.
    00:39:14,237So I created this,
    00:39:17,289and then I just told the light wrap layer,
    00:39:20,999"you use that as a luma matte."
    00:39:23,819And if I solo that, you'll see now
    00:39:25,889we're only getting the light wrap on that one side.
    00:39:28,569It actually tracks perfectly with the layer.
    00:39:32,949So there you go, if I turn that to No Track Matte,
    00:39:35,202you'll see I get the super glowy heavily look,
    00:39:37,417which maybe is cool,
    00:39:38,567but if I use that illuminance matte,
    00:39:40,647it kind of constrains that to just one side of the rocks.
    00:39:45,577And who knows, maybe you can kind of animate this
    00:39:47,943and have that light kind move around or something, but...
    00:39:51,754I just thought that was a neat way to control that.
    00:39:55,554So there you go.
    00:39:56,387You've got your 3D scene, and...
    00:39:59,928Let me switch this back to Half res
    00:40:01,155so we can do a quick render.
    00:40:03,155You have your 3D scene.
    00:40:05,245It hasn't been color corrected,
    00:40:07,785and of course I would add a little bit of a grain to it
    00:40:09,995because if you're shooting with any kind of video camera,
    00:40:12,775there's gonna be some noise.
    00:40:14,155So it's not gonna be a perfectly crisp image.
    00:40:17,641And there are a lot of other things you can do.
    00:40:19,331I added some little kind of whispies blowing in the wind
    00:40:22,481and that kind of thing.
    00:40:24,321But hopefully, you guys learned some neat tricks
    00:40:26,597and next time you're asked to do this with a still image,
    00:40:29,547you have a few more bag of tricks, and believe me,
    00:40:33,547that is very handy when you gotta do
    00:40:36,23210 of these really quickly.
    00:40:38,502You don't really wanna have to think too hard sometimes.
    00:40:40,472You just wanna know what you're doing, and know the steps
    00:40:43,145involved and put your headphones on and get it done.
    00:40:46,065So...
    00:40:47,524I hope that everyone enjoyed this,
    00:40:50,892and I'll see you guys next time on 30 Days of After Effects.
    00:40:54,423Thanks so much for watching.
    00:40:55,923I hope you learned a new trick or two so you can make
    00:40:58,212your full 3D scenes in After Effects look really great.
    00:41:01,322If you have any questions or thoughts,
    00:41:02,797definitely let us know.
    00:41:04,277And we'd love to hear from you,
    00:41:05,627if you use anything from this lesson on a project.
    00:41:08,364So give us a shout on Twitter at School of Motion
    00:41:11,239and show us your work.
    00:41:12,389Thank you so much for taking the time to hang out,
    00:41:13,909and I'll see you on the next one.
    00:41:16,413(sound effects and fast beats)