Introduction to Camera Tracking in Blender

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
ok it is the 6th of March 2012 and I was going for a walk this morning and I discovered this massive hole in the middle of the road it's a little bit scary I don't know what caused it I don't know how long it's been here I'm assuming it crept up overnight from the the rain we've been having the last few days and uh it's a little bit scary I don't know how deep it is because I haven't gotten that close to check and I don't want to but yeah yeah so that is a hole in the road g'day and welcome to a new blender guru tutorial and of course the video that you just watched is not real it is in fact the topic of this tutorial which is all about camera tracking so it's a new feature in blender which allows you to take real video footage that is filmed with a real camera and then to add 3d elements to it so it's very very exciting it opens up a whole world of opportunities literally that you can now do in blender you can have robots fighting on a street you can do some UFO hoax videos you can do a sinkhole hoax video in fact the reason I created that that little video there at the start was to see if I could possibly fool the YouTube community into thinking that the sinkhole was real so I posted up the video about 12 hours ago and I'll be honest most people didn't fall for it the majority of my subscribers on YouTube are of course you guys blend the users which is like trying to do a magic trick to a bunch of magicians very very hard to fool you guys are very good you spotted it and and called me out on it but I'm going to leave the video up anyway and maybe some other people will find it and see what they make of it but anyway it's a bit of fun you can have a lot of fun with this new feature and and that's what we're going to be learning about in this tutorial so if you don't know anything about camera tracking you don't know what it is where to start you don't know what all the fuss is about then this video is for you so I'm just going to give you an overview of it and show you briefly how you can start tracking basically so this is the finished result that you can see right here this is what it looks like in blender so what I've gone and what I've got is the video which has then been tracked and then you can see that my actual camera here in blender is moving to the exact movement of the real camera the one that I was holding and filming so so that that is essentially how this this camera tracker works so I'll just show you now what the camera tracker looks like this is it right here so the way the camera tracker works is it takes individual points of a video of high contrast for example are these little white dots that are here on the road which we'll put there deliberately by myself by the way it takes those little points and it is able to track them so you can see up here in the top right window you've got this little window here which is tracking this one little white dot on the floor and all of these points are doing that so that is how it's able to track it so essentially what we're going to be doing in this video is taking a short segment of this video showing you how to set up these little points and then export that over to a real camera here in blender and and then start adding in this hole right here so I'm without further ado let's go ahead now and open up a new scene in blender okay so let me just turn on the screencast tools you can see what I'm doing okay so in order to access the camera tracker what we need to do is change it from 3d view down here to movie clip editor which is a new feature you've probably never seen before so go ahead and click on that and then we're going to go ahead and click on open and we're going to load in our video so the video I'm going to be using is available if you're watching this on Blender girl you can go ahead and download it right there and it is a short segment of the full video that you just watched okay so it's like this okay so the first thing you'll probably notice when you're looking at this video is in this movie clip editor here is it along the bottom here you've got this blue bar okay and then as you scroll through it or if you play it if you hit alt a you'll notice that some of the frames are a light blue color and then the others are a dark blue color now what that is is essentially cased frames in blender okay so if you're not sure what casing is it essentially means it's kind of temporarily saved those frames so it's easier to view later on now you'll notice that only about 50 frames are able to be cased at a time okay now the reason for that is that by default blenders cache amount is very small so you can change that by going to file user preferences and clicking on system and then down here underneath sequence you can change the memory cache limit now if you want you can go ahead and turn that all the way up to maximum which would be your amount of RAM so I've got 16 gigabytes so that's why it's at 16,000 it was might be different you can go ahead and turn that all the way up to maximum now because I'm recording a video it can kind of stutter if I use the maximum Ram so I'm going to go ahead and use half but you can go ahead and use all that you've got that's fine so once you've gone and changed that you'll notice that it is now able to cache in essentially all of your video footage now when it gets to around about frame 210 you'll notice that it stops now the reason for that is that that is how long the actual video is so if we scroll back here you can see where the video stops it is exactly to frame 210 so in the timeline I'm going to set my end frame to be 210 so you can now play through the entire thing and it's now caching all of the frames and we're good to go okay so in this movie clip editor where we're going to be doing our camera tracking you've got a number of settings that you have probably never seen before and it can probably look a little bit daunting when you first come here you've got you know track you've got markers you've got cameras all you've got all this stuff and it looks very confusing when you first come to it but once you get started you actually get into it it's actually very easy and I know I always say that but it actually is it's actually quite fun as well I I've kind of enjoying tracking things now when you've got good footage that actually tracks well it can be fun if you've got bad footage that can be bad we'll get to what the difference between that is later but to give you an overview of what everything here does okay so essentially the way this works is you drop in a tracking marker so you can go up here in the top left-hand corner and you click on add marker move and what this is going to do is it's going to add in one little marker and basically the aim of this is to drop it in a place where there is high contrast areas so I've got these little white markers which I put on the road deliberately so that it's easier to track that's something that I learnt from many failed video attempts um so I put them there anyway so once you've got one of those markers there you can then go ahead and track it by clicking on this little arrow there and it's going to try and track it through the video just like that and actually it's really cool because the these markers you can actually select them you can move them using all the keyboard shortcuts that you're used to in blender so if you want to move that marker you then just go ahead and hit G and you can move it it's normally not connected like that if it's a new marker then yeah you just go at you press G and you can move that marker to be somewhere else if you want to scale it you just hit s so these are you know shortcuts they already used too if you want to delete it go ahead and you hit X and you delete it so it's actually really well done the way it's designed you already know all the keyboard shortcuts and it's it's very cool anyway okay so getting back to tracking okay now there are two ways of tracking a video shot using this camera tracker there is the lazy method and there is the manual method now I highly recommend that you use the manual method and I'm sure that if you try to use the lazy method you're going to realize why I'm essentially the the lazy method if you hit detect features okay so up here you click on detect and it's going to try and automatically detect where the high contrast areas of your scene are and it's going to try and track it based on that now if we do that let's just give it a quick test right now you'll notice that that's a very very poor job it only gets about halfway through the scene before it's lost all of the tracking markers and and it's utterly failed and you can tell looking at it it hasn't picked some high contrast areas that are actually good look at it it's like pick some dark area here in the bottom left-hand corner where there's almost no contrast at all and it's left all these white dots here relatively untouched so it doesn't do a very good job I'm sure that in the future that feature the detect features button it will do a better job but currently it does a poor job and I actually recommend that you when you're at least first starting out in particular that you get into the habit of adding your own markers anyway because it's better for learning and it's going to help you in the future when you film an actual shot to understand what makes a good shot trackable and what makes bad shot untrackable so this is all part of the learning process and it's also quite fun anyway so we're going to do the manual method so make sure you are on frame 1 okay so you do that by hitting shift left arrow if you want to go to the end frame you hit shift right arrow little keyboard shortcut there for you anyway to add a tracking marker what you do is looking at your video footage here you hold down control and then you left-click that's a shortcut or you can go up here and click on add marker and move it does the exact same thing one is a lot quicker than the other so I highly recommend just clicking like this okay so once you've added a tracking mark I just go ahead and click on one of those little white dots there you can then track it to see if that is a successful tracking point so over here we've got the track you've got these little buttons here so we need to go ahead and click on the right arrow button and that will start tracking so let's do that you click on it and you'll notice that it gets up to frame 73 and then it stops now why is that do you think well when it stops it means that it has lost the tracking marker and a telltale sign is right up here where it's got the little tracking window it suddenly goes a pale red color to let you know barrel you've failed try again now it can fail too it can lose a tracking marker for a number of different reasons if you go here in the top left-hand corner you've got tracking settings now here is where you can start doing some manual adjustments you have got the pattern size and you've got the search size you've also got the tracker correlation you've also got the match there's a whole number of these feet so let me just go through what they are briefly okay so the pattern size is the size of the area which blender is going to try to match frame by frame okay so if I let's say set this to be 50 and then I click here you can see that it has now in this little top right hand corner it's trying to track that entire area so it's got all that black and then it's got that white little dot in the center there now that's good it's going to give you a probably quite a secure track but it is going to be a lot slower than if you use a smaller size if you want a you know a fast track then I highly recommend you use small as smaller pattern size as you physically can so you can actually get away in this scene with a pattern size of just 10 if it's done properly so if you just set it to be let's say on the corner of that little white marker there and that and where the road means you're essentially trying to match it up with a high contrast area so just like that now the search size is the area in which blender is going to search for this location so if you've got really jumpy choppy footage going everywhere then you're going to want a larger search size so if I just turn on search in these marker display here turn on search you can actually see the area that it's going to look for that now that search size is actually quite big I think we can get away with I think 31 is enough also one other thing the functions over here on the left hand side these tracking settings they will not change markers that are already in the scene this is only for new tracking markers that you're going to place so you can see that now I've changed that if I click over here it's now I change it to the updated these settings over here that we've just changed but this one remains the same if you want to change a marker that's already placed you want to change the settings you go to the right-hand side underneath these tracking settings here and then you can change you know you can change some functions there if you want to so you change these settings over here then you start to place the markers that's generally the gist of what you do now so you've got the pattern size that size of that area you've got the search size which is the size that it's going to be scanning in and you've got the tracker now there are two types here si D klt and you've got hybrid to be honest I don't know the ins and outs of what that does okay it's this is very new this feature in blender there's not there's hardly any documentation on it um I heard somewhere that si D works better than klt in some circumstances you don't really need to worry about that just leave it on a hybrid that'll be fine for I don't know most of what you do I'm guessing I haven't had to change it so I'm assuming you probably won't either at least when you're first starting out now the correlation that is essentially the threshold that it's going to try to track by okay so the lower you set that to the more leeway it's going to give so if you set this to a very low amount like let's say zero it's going to track it really loosely as in like if you've got really shaky jumbly footage and you know it can't find anything to track you might need to lower that correlation size and it's going to allow more leeway so more changing of this tracking marker and it's going to work a little bit better however the higher you set that to the more secure and rigid the tracking markers are going to be so I actually recommend leaving it at 0.75 that's actually pretty good because that's going to give you a more you know solid looking track at least in my experience you're going to get less slight moving of your objects and it's just going to look a little bit more secure so leave that at that the frames limit this number of frames attract I haven't changed that that's fine the margin that is the sort of the boundary box for the edge of the video frame so if you've got a marker that's kind of reaching the edge and then it's sliding as I think can sometimes happen I haven't had it too much then you set the margin and it's going to cut it out before it reaches the edge so if you set that to five it's going to cut out them are the tracking marker five pixels before it reaches the edge so just set it as five that's fine it doesn't really matter that much now down here where it's got match you've got two options you've got previous frame and you've got keyframe now from my experience I have found previous frame actually works better than keyframe now I don't actually know what those do I don't know the ins and outs of it because there's no documentation on it and I've just from my own experience I've found key frame tends to lose the markers a lot easier than previous frame previous frame tends to match it to what the previous frame was anyway I found it works to be a lot better go ahead experiment with whatever scene you've got going and it might you know you might find things are different anyway I'm leaving mine set to previous frame okay that's what we're going to use for this tutorial and the rest of it you don't need to worry about yet the solve that's after you finish tracking scene with cleanup same with clip arm all you need to worry about is this part right here okay so once we've set the settings we can now go ahead and start tracking some points so let's go ahead and click on let's say this dot right here you want to Center it in the white area as much as possible so looking up here in the right hand corner you've got that little box there let's try and get it in the white marker as best as possible these white markers by the way I placed they're just a piece of white paper stuck to a coin so I threw them out there because I previously tried to use it with little tiny stickers which I stuck on the road and I came back to my computer and I tried to track it and it didn't work because the stickers were too tiny so I got some coins put some paper on it went out there shot it again and it worked a lot better so this works for this scene of course by having these you know white markers here because that's where my hole is so the hole is going to be covering up that hole area where the markers are so that's why I can get away with using physical markers if you've got a marker in the shot that you don't want to be in the final thing then you're gonna have to do some fancy stuff probably with After Effects where you actually try and remove the marker from the scene but that's just getting a bit advanced anyway on by the way I'm ctrl left clicking on these points here and then if if it's not where I want it to be like if I click here and I want to move it I just push G and if you hold down shift as well then you can make it move in smaller increments so it's easier to find the exact position and I'm just going to go through and I'm just clicking all of these so that's piecing our way through it now you may find that when you start tracking this some of the points are going to be fine and then other points are going to be lost and that's just the way it works I have some points you can tell they're all different some points are going to work better than others you may have to change some of like the pattern size of the search size for some points but generally if you do it well you should be able to use most of these settings the same for everything some of these points by the way are actually cigarette bots because I only had a certain number of coins on me because I'm poor no um I am had yet a few number of coins on me and I wanted some more tracking markers so I went into this little field over here to uh and I found a cigarette butt and I was like all perfect that's why I can use that and I was like that that's good I found one cigarette butt and then I was like oh there's another cigarette butt and another one and I noticed that like all along this field here with just cigarette butts just in the Dern it's smoking is quite big in Korea so there's uh there's a lot of cigarette butts just everywhere I found so that was pretty disgusting picking up dirty cigarette butts and throwing them out onto the road and actually the guy that lived on the left hand side over here he came out for a smoke to watch me because he was utterly baffled why this white guy was out on his road filming and throwing cigarette butts around so I'm I'm fairly certain I confused him and yeah anyway so the the whole point of this is to get some areas that are in the foreground and some areas that are in the background so sometimes you can get it with just a few markers sometimes you have to use more the more markers you use and you have a mix of background foreground the better the overall tracking for the scene is going to be so I'm now just going into the background here dropping in a few markers of any of these cabbages I guess which they're growing there I don't know who owns these fields they're just everywhere in the area that I'm living at the moment and it's just yeah the fields are very bizarrely placed like this just all these buildings everywhere apartments and then just mixed in between them you've just got fields just wedged in between two apartment blocks you've just got a field of cabbages and some of them are empty some of them are full of rubbish and it's quite bizarre but yeah the the area I live in in South Korea is a kind of a country town it's um it's where my girlfriend is going to university so I'm just doing my best to fill up some time just talking about random stuff whilst I track things it's a it's kind of a I don't know it can be fun it's a very good learning experience tracking things by hand it kind of gives you an idea of what a good track scene is and it trust me after you spent a whole day of tracking something the next time you watch a video or you go outside and you're like walking down the street you'll see like you know like a cigarette bottle on the road or something and you'll be like oh that's a good tracking point or you know you you walk up to a door and there's like a nice corner and you got all that's a good tracking point and time it's very weird you never notice that stuff until you um t start tracking and actually I remember I think was about 8 years ago I had my first experience tracking a scene for a high school short film that I was making and I wanted to add like a security camera in the scene as it part of the the plot and I filmed just a white wall and I moved the camera up you know and that in the corner that was supposed to be you know the camera sitting there and I was up all night trying to get this scene tracked because it was a white wall and there was no point that it could grab and it eventually felt I could not track the scene I had to use another shot which was worse but it had someone's head in the way so it could track that scene or whatever anyway I'm kind of rambling I think that is enough tracking point now that's going to be enough the most important thing is that you get the area where you know the 3d element is going to be you get that area down pat because that is the part that needs to be the most secure so provided you've got that it should work fairly well anyway I'm going to select all of those points there by hitting a which is a keyboard shortcut you probably all use too so you hit a it's going to select all of them and then you go ahead and track it if you only select one and then you track it it's going to just track that one individual point which is kind of useless so select all of them and then go here where it says track and I'm going to go ahead and click it and you can see that that is actually tracked fairly quickly now the reason is tracked fairly quickly is because we've optimized it by setting the pattern size to a small amount the search size to a small amount if you set these sizes here to large you may find that it takes close to an hour to track so that's why it's very important to to get that right but as you can see here most of the tracking points stay in the place these points here by the way this point and this point that little point looks like a dud that means that's a point where it's lost its tracking marker now you can see that up on the the corner here of the screen you've got a whole bunch of tracking markers that will lost and that's mainly of course because they've gone off the edge of the screen so that's fine you don't need to worry about them that's going to happen obviously but provided the majority of these ones in the foreground are still here it spits a successful track so now that we've done that we can now go ahead and move on to the next thing so once you've successfully tracked a scene like this now comes the part where we actually export it or get all this data here to apply to our actual camera that is actually in blender okay so let me just get a drink of water before I start talking again okay so first thing that we need to do is on the right hand side you've got something here called camera data now this is very very important this camera data will dramatically affect how successful your track is you need to change your camera data to accurately reflect the reflect the settings of your camera now the reason you need to do this of course is because the focal length you know the sensor width size this all affects how an actual shot or a video looks so if you've zoomed the camera in more then this focal length is going to be different than if it was zoomed out and the to track it blender needs to know that exact data so if you don't know the phone call the focal length of your camera or the sensor width of your camera you need to go ahead and find out what that is so you can do that relatively easily by going to your internet so I'm just going to go ahead and do a search okay so my camera that I used was a can on five fifty just because I know somebody's going to notice this when I just I typed in C then it came up with cabin porn that's not a pornographic site okay that is where you find architectural images I just want to make that clear because I know someone's going to write it in the comments that I was anyway so my cat my camera is a Canon 550d so I'm going to type in Canon 550d specifications let's go ahead type that in and you've got a whole bunch of stuff here I'm going to go ahead and just click on this PDF because I know that's where it is so I'm going to click on that and you do we've got the specifications for my camera that I filmed with now your camera might not be the Canon 550d you will have to search and find it yourself it's pretty annoying and it's one of those things it's going to take you a while and I'm assuming that in the Chah oh look at that there is some data there well you can change that that's brilliant okay I don't know how long that's been there well you've got the camera preset that's that's great you got the Canon 550d cool anyway what I was gonna say is if you don't if your camera isn't in this uh that's so weird I did not know that that was there and this was one of the things that I was hoping it was going to be there and I don't know how I didn't notice that anyway it's right there Canon 550d so it's set my my sense of width to be the correct one so if you if you don't know what your sensor with is you find it under you know where your image specifications are image sensor type and it's got you know time something millimeter it's the first one it's the width so two two point three that is the width of the sensor okay so that's why I've put that in there now the focal length is whatever the lens is set to okay now the Canon 550d has interchangeable lenses so that's why these presets here haven't changed this value because you need to actually know what type of lens that you used on your camera now excuse me in my case I do know mine is 18 millimeters so I'm going to go ahead and change that to 18 millimeters now these other settings here you've got lens distortion that's for more advanced users that's barrel distortion where the lens has actually bent the image slightly that's if you want to get like a really really super secure track so if you're in a really advanced user and you want to go through that go ahead and do that there's not really much information on what these settings here do yet if you want to start tweaking it I have heard that the K one is the one that you actually you want to use and if you want to start filling around with that then I think it's where is it grease pencil Oh anyway it doesn't even matter lens Distortion you can fiddle with that if you want to provided you've got the focal length you've got the sensor width that's all good to go we're then almost up to the final step where we're going to calculate the motion but there's one more thing we need to do and that is this part right here you've got the key frame a and you've got key frame be that's very important that you pay attention to this part because if you don't you scene may be screwed up very high chance of that actually so keep what this is is it's telling blender where there is significant parallax movement which sounds like something from a science textbook but really what it is is you're telling blender where there is significant movement from the camera as in the camera is actually shifting position so you need to find a position in your video where the camera is actually moved forward so if you're holding the camera and you're walking forward whether you know whether it's actually moving that is a good point to put you know this you know keyframe main keyframe be so currently it's at frame 1 to 30 and as you can see from here there isn't really all that much forward movement from those two frames are from those two keyframes there so I'm going to find a part where there is significant movement so I can see here starting at frame 40 it steps forward it twists to the side a little bit and there's an extra step there as well so from frame 40 to frame 90 I can see there is a lot more movement now by the way if you're wondering why we have to do this my guess is really that the reason you need to do this is so that blender actually knows sort of the depth of the scene which points come before other points and stuff like that so if you didn't have this and it'll be hard for blender to kind of make up the rest of the scene so that's why you need to put this in yourself so I'm changing keyframe a to 40 keep frame B to 90 and that should do it correctly now if you if you find that after you've you know calculated the camera motion of the camera motions all shaky and it's completely wrong chances are you need to change the key frame a and keyframe B that can dramatically change how the the end camera movement actually looks so just something to note there anyway now that we've got all this set up now we can go ahead and click that golden button right here underneath solve where it says camera motion so go ahead and click that and you'll see up the top there it says completing solution then it says bundling and it weights at 99% for a little while it can take longer depending on you know how many points you've got it's finished now now you'll notice that down here in the bottom right hand corner it says average solve error 0.6 now that doesn't mean that there's a fault with it that there's some big error you need to fix there's always going to be an average solve error what that is telling you is the how accurate your tracking is so the higher that number is the worse your track is okay so the you want to try and get that number as low as possible they say that if you can get it from if it's less than 1 then that means it's a really good track so actually this here 0.6 that's a pretty good track and if it's 1 2 3 that means it's a good track and if it's more than 3 then there's going to be some issues with it and you probably want to go back and try and fix it as best you can so those are just some kind of values to go off now you can actually experiment with your focal length because um I sort of actually noticed I thought that my lens was actually on the lowest possible function which is 18 millimeters but I found that actually if I set this to 19 millimeters and then I hit our camera motion again that I actually get a solve error as it comes up a second to do oh yeah you can see I get a solve error of 0.5 9 which is actually slightly less than when it was on 18 so that can actually tell me that it was actually probably closer to 19 millimeters than 18 millimeters so if you you know if you're not sure what your focal length is and you're kind of thought or maybe it's around 25 maybe 30 you can experiment with that by setting it to different ones and then trying to get that average solve error as low as possible and then once it's as low as possible then you'll know that that probably what the lens was set to so that's just some information that you can go off anyway provided you have done that we can now go ahead and switch to the 3d View mode and here we have our nice camera sitting here waiting and if we hit alt a you'll notice that nothing happens the camera is just sitting there okay so happening well that is because you need to go to the object constraints panel right here and then we need to add a camera solver so go ahead and click that and now if we hit alt a you'll see that the camera is moving and you also have these lovely little points these little empties which have been placed in the scene and they actually signify where there is a tracking point from the video so you can see now it looks as though it has tracked correctly so actually if we go back I'll just split this view here because we're gonna do it just a tiny little bit more work with the movie clip editor if I click on down at the bottom here where it's got clip you can click on set as background and then when you look through the camera viewport you now have the the actual video that's been added to the backdrop for you so having a look at this you can see that those little empties are in the same spot or where they should be basically provided they're not sliding around like crazy then it means that it has been successfully tracked so well done yeah none of applause it's been looking good okay but there's are still a little bit more work to do okay so for for one thing you can notice that these empties here are kind of just randomly out in the open there that really it's very awkward if you were to try and work with this scene you know you you really want these empty points up these basically where the actual physical floor in your video you know the road you want that to be on the grid floor right here so there is a very very easy way that you can do that using the movie clip editor and that is I should have told you this before there's actually different modes okay so there's the main tracking one right there and then there is the deconstruction mode where the deconstruction mode is sorry reconstruction mode that is a mode that you use right at the end after you finished tracking that's when you can start to set up the scene I actually haven't used distortion mode yet I think okay it's not really much there anyway we won't use distortion we're just going to have a look at reconstruction so the way this works is you can see you've got here orientation so there's a button there that says cette Fleur so what it needs is three tracking points that you want to make the floor so I'm going to select this point here that point there and then that point there so that's where I want the actual floor of my scene to be once I've got that I'm going to go ahead and click on set floor and you'll see that now those tracking points have all been placed directly on the grid floor and that is just beautiful absolutely perfect to work with because now you can go ahead and add objects and it's just going to work out really really nicely and also if you've got you know the same kind of off to the side and you want it to be positioned more in the center so let's say I want the middle of this whole I want that to be the the actual center of my scene I can go ahead select that tracking point and then click set origin and now all those tracking points have been shifted and and it's looking good you've also got the set axes as well so if you wanted to change sort of what position they're on you can click set X or set Y if you know the orientation is a bit mixed mixed up anyway those are just some things that that you can play with all the other one that you might want to play with as well is the set scale so if you wanted to set say these two tracking points here you can say the distance between those two is five meters even though it's not it's probably two meters so go ahead you can just you know there's some stuff that you can play with here I'm just kind of just showing it to you how it all works and whatever else it's pretty straightforward so it's looking really good right now because now you can see it's very easy for us to kind of you know just start adding stuff but there's one more cool thing okay you've got the set up tracking scene button so go ahead and click that okay so now you can see you've got a plane and a cube probably thinking Andrew that's pretty useless I don't want a plane and a cube in my scene but what it has also done apart from just adding those two objects is it has gone in and added to render layers for you the foreground and the background it set up the Z and the this one's got vector shadow and ayoh enabled and if you switch over to the compositor you can see that it has added in all of these nodes for you now you might not know what these nodes do just yet don't worry about it too much but essentially it's made it so that it's giving you a ground floor which has calculated the shadows the ambient occlusion which you can then you know place any object on top of and you're going to have shadows you know it's probably easier if I to show you so let's just jump over here just moving that out the way okay so just having a look at the scene here I'm just going to go ahead and move this cube up so just it so that it's sitting on that plane right there and I'm going to go ahead and give that a render and you can see oh I don't have a light in my scene oh wait yes I do okay that's very bizarre let's position that a bit up there give that a quick render okay so there's something going on okay so mine is both set to background of what yours should automatically work I actually made a mistake in the recording so I had to go back so I think it's screwed up but anyway that should automatically be set up so you should just be able to if you click on set up tracking scene it will automatically set up your scene so that now you have a ground floor which you can which is going to be able to receive shadows and ambient occlusion and then you've got objects which you can then you know position any object on top of and it's going to automatically calculate shadows and the the stuff and cast it onto this plane here because if you didn't do that it would be very difficult because you've got a plane which is sitting over the top of a video plate and you then have to try and work out the materials and stuff like that so by doing that clicking set up tracking scene is done all of that for you all that hard work so you've got you know just the one with the background you've got the one with the foreground so yeah so essentially what this means is you can delete this cue and then add anything on that first layer right there and you know a robot or whatever you want and it's just going to look seamless with the rest of the scene so um so yeah so that's it that is the tracking camera tracking done and dusted so if you wanted to follow this tutorial just up to this point you've got some nice-looking tracking that's it that's that's where our up to so go ahead and play with that all you want if you want to work out how I created that sinkhole video then continue on because that's what I'm going to show you right now so the sinkhole okay so the way this is done the way I created the sinkhole effect was I used this plane here to blot out sort of a portion of the scene and then I cut a hole in the center of it and then made a cylinder type tube thing which then creates the illusion of a hole because you know the cylinder the rest of the cylinder is hidden underneath this plane and then through the hole you can see the rest of the cylinder anyway that's just a basis for it so we can go ahead and delete this cube here and also if you want to remove the tracking points at any time you can just go here underneath display and just turn off motion tracking because it can sometimes be annoying if you're accidentally selecting the tracking points so anyway um alright so first thing I'm going to do is go ahead and add in a circle so I'm just going to piece together the hole I'm going to give it 200 vertices and looking at it from the view of the camera let's just do that I want to make it roughly that size right there I'm just going to scale it outwards and upwards make it kind of an oval looking shape like that okay that is not bad alright and I want to create that nice crackling looking edge okay because I don't want it to look like a perfectly smooth hole because that would be ridiculous so I'm going to hit o which is going to turn on this proportional fall-off editing thing I'm going to set that to random and I'm just going to select this end point over here alright you know sorry I'm going to set that to sharp I'm just going to create a few nice little sharp points here maybe one here I'm just trying to give it kind of a randomized looking shape I'll change it to smooth now as well okay and then the best one is setting it to random fall-off if you just click a bunch of random points like is and scale it inwards you can see you can kind of create a very quick rough rippled looking edge just like that so that's just a really quick and dirty way to just create a crackled looking effect I made a tutorial on that already and how to create a crack how to model a crack in under two minutes you check that out if you want anyway so that's a little hole there so then I'm just going to go back into edit mode and I'm going to extrude this back out whoops turn off proportional editing and I'm just going to extrude that outwards like that okay and making sure that that is moved to the same layer as the plane as you can see it is then I can go ahead and delete that plane okay so now I've just got this nice big hole in the ground now I'm going to create a cylinder like this drop this in right here I'm going to uncheck cap ends and I'm going to scale that up till it's roughly about just a little bit smaller than the size of the hole you don't want it to poke out of the hot light be visible from you know in the hole if you're not I mean so you just want to create the the walls of the hole hope this is making sense just like that it's cool and I'll just move that down slightly and I'm just going to set this to smooth shading so you can see the kind of effect that we're having here now if we've done this correctly now provided that the hole into a hole itself the cylinder is on layer one and then this sort of ground plate here is on that layer so this is the foreground this is the background kind of hard to you know relate to that because this is really a hole in the ground and you know how is that the background when it's the foreground anyway don't worry too much about the terminology but we should now have this effect right here pretty straightforward that's essentially how it is done now I'll show you because I know you may want to know just a little bit more on how I achieve the rest of the effects so I'm going to show you how I texted the inside of this and then we're also going to add some cracks to the surface here as well so again I mean if you only came for the camera tracking we're really just you know free balling and at this point just Mac mucking around adding in a few extra details having a little bit more fun with it so we'll do the the inside of this hole here first so I'm going to go ahead give it a material no specularity at all and the texture that I'm going to use oh actually first of all I'm going to UV unwrap it because um we can because it's a hole in the ground I'm just going to add a seam right here where it's obviously not going to be visible to the camera so I'm just going to hit control E and select mark seam UV image editor I'm just going to very quickly unwrap this hit you unwrap and then I'll just scale it up like that yeah that's good very quickly UV unwrapped then I'm going to go ahead and use a texture which is actually from the nature Academy not that one let's use the ground textures so I've got a bunch of seamless textures here I'm going to make it available to you guys if you want to check it out it is the Red Rock texture this one we're going to use you can go ahead and download that that's a little freebie for you we're going to use UV mapping coordinates because we've just UV unwrapped it I'm going to set the X and the y I'll set them now we'll leave them no I think I'll set them to two and four that's what I did before just trying to guess exactly what it was that I did I think that should be fine let's give that a quick render with that ground texture that's not bad it's okay it's better than before at least now for the lamp because we should probably work out the lamp whilst we're here I'm going to make this an area lamp I'm going to set the size of it so that it covers the size of the hole just roughly like that it's pretty good turn the distance down to let's say about ten and I'll give that a quick render now see how that looks and it's not too bad I'm gonna turn up these samples you want to make sure that you know your lighting for your scene best matches the actual lighting for the physical Sene so you can see that it's an overcast day so you don't want to have harsh shadows like was there before so turning the samples up to four it's got softer looking shadows which of course blends in a lot more nicely with the rest of the scene now originally what I did for my final scene was I did some work with texture nodes in order to blend another rock texture in there so you could get kind of like a layer effect happening but when we get into that it kind of gets a little bit too advanced and it's not really for this tutorial so if you want to check out the final blend and see how I created the exact texturing for this this hole here you can go ahead and do that but we're just going to keep it pretty basic so I'm just going to leave it as this you know basic looking dirt looking texture here and what I'm going to do is just quickly add in another texture here another gradient and this is just going to fake some ambient occlusion or really just making it so that it we're faking a shadow from the inside of the hole here because currently it looks like the hole is very well lit and in order to fake its depth I'm just going to quickly drop in a a blend texture here so I'll just set that color there to dark I'll set the mapping to UV and then I'll set the blend to vertical and then let's flip that around and now if I give this a render you should see a little bit it's a little bit darker towards the bottom of the hole and you can increase that up even further actually it should be a little bit more than that what's happening let's turn it color blend mapping let's increase that even higher perhaps okay there you go you can see it's kind of coming into there so that's how you fake the look of the hole looking quite deep very cheap very nasty but it does the job so so that's where we're going to keep it as so that's fine um oh I just let me just set this back to the way it was before I did a little bit of work whilst I paused the recording and that one law was unchecked anyway back to where it was so that's the whole is looking quite good at the moment now getting onto the final thing and that is to add the cracks around the outside because I know that some of you will probably wondering that in the video so one of the little touches I added to try and make it look a little bit more realistic so to do that it's actually really quite simple I'm just going to take this ground plane right here I'm going to go to the uv/image editor just go like this and I'm going to UV unwrap it or just go project from view just like that and actually what I did was I went to UV then I went export UV layout and then I took the UV layout into Photoshop and I got I created this picture that you can see right here which is really just a bunch of cracks which I got off CG textures and then I use the liquify tool in Photoshop to kind of bend them around the shape of the hole now again that's getting a little bit too advanced for this tutorial so that would take too long I think to include it in here it's pretty basic and guys can figure out what to do it just takes a little bit of time just bending it warping it to the shape of the hole so I'm just going to go ahead and just use this my pre-made texture that I've created here I'm just going to use this in the scene so I'm going to go to image open image and let's go with cracks texture 8 just going to load this in right here let's go project from view again and you can see it's got quite like this pixelated effect there and there's no option here to click pre-multiply so what you have to do actually if you want to get rid of that effect just give it a material right now then go to textures image and then select from the drop-down list that cracks right there then click pre-multiply and then it updates it here in the UV image editor it's kind of annoying but that's just one of those things you have to do so I'm going to hit project from view and then you want to make it so that it's at the center it's kind of hard to see because you've got the vertices and stuff already there it's kind of a little bit tricky you kinda I'm sure you get the idea it's just creasing it a little bit buy more yeah just like that I mean I think that should be pretty much fine so then I'm just going to go here click on UV make sure that it's map for UV just like that and then going back to our main material here I'm going to go ahead and check shadeless just like that and now if I have a look at the background as I give it a render what we should see is that right there just as it was rendering you can kind of see you've got the cracks they're appearing and it's looking quite nice the cracks are sleeping on the wrong side there so I'm just going to go back to the uv/image editor I'm just going to flip it around just going to rotate that by 180 degrees so that the cracks are on the right sides if they're at the front there we go just like that I'm going to take the background turn off sky so it's not rendering this guy at all I'm going to go to the composite R and let's just give it another quick render now and I'm going to take all of this shadow ambient occlusion all that stuff because I don't need that because there's actually nothing on top like there's nothing there's no shadow that used to be cast onto the ground itself I'm going to go ahead just delete that I'm going to add a mix node in right here or am I going to add an alpha no yeah hang on yeah mix node just connect that up to the image I'll set that to add let's just see how that looks yeah that looks great I'm just going to quickly change the diffuse color for that material all the way to why I essentially just want a solid white looking texture like that and then I'm just going to drop that in there into the multiply node and you can see you now have cracks over the whole pretty simple indeed I'll just turn that all the way up to one so you can see that and if we tweaked it even further it's not properly UV mapped at the moment it's kind of a little bit off so if you just let's just bring back that texture there oh I can see it's kind of moved it around for us how nice so what I wanted at all okay that's good let's try that now so there you go now you've got cracks around the hole so there is one final thing that we'll do and that is to just add some thickness to the actual road itself because if you have a look at the the finished render the road is very very paper-thin looking so of course we want to fix that so I'm just going to grab this edge right here I'm going to hit d to duplicate it then I'm going to hit P to make it a separate object I'm going to grab that separate object move it to the foreground layer so the same layer that the hole is on I'm then just going to grab it extrude it downwards as you can see SuperDuper easy some people said that the road in my final animation was too thin which I think I actually agree with so I'm just making a little bit thicker there just like that and for the material I'll give it a new material I'll just make this a very walk it's the specularity anyway doesn't matter um I'll just make it yeah something like that I think let's just give it a quick render now let's see how it looks with the rest of it I think it's too dark let's just brighten it up just slightly almost there coming up to the final stretch now let's probably a little bit too much and also I'll just recalculate the doubles because I can see that was just something a little bit wrong with that you can also if you wanted to you could add a little bit of randomness to the edge of that as well just um I'm just grabbing just the bottom row there so if you didn't know what I just did then just select that top row like that hit H to hide it and then I'm just going to select some of these random ones right here and just do just like I did before using the random fourth just scale them in a little bit that just adds a little bit more randomness to the edge as well let's give that another render right now and we should see it sort of coming together now as one yeah that's uh let me just bring back the other one I think it's probably a little bit too thick now so and and I think it's a little bit too bright as well so these things take a little bit of tweaking to get right but that is that's pretty much it guys that is roughly the tutorial in a nutshell so what I'm going to do now is I'm going to go ahead and render out this animation so just go to the output just select a folder there somewhere on your hard drive render out the frames and then we'll check out what it looks like when it is finished okay so it's just finished rendering out the two hundred and tenth frame of the animation so I'm just going to quickly now jump over to the video editor and I'm going to go ahead and add in all of the frames that it's just rendered and I drop this in right here let's go full frame and hit alt a and there you go so you can see our whole is staying perfectly stuck into the video the tracking is looking brilliant you can see that it's worked successfully and the whole looks believable so that completes this tutorial guys I hope you learnt a couple of things from it and as always I'm really really interested in seeing what you create with it so if you make something awesome upload it on YouTube make sure you give it the correct title like blender camera tracking or something like that so other people can find it and then go ahead post it in the comment below show off what you've done and I'm really looking forward to seeing some of the the cool and creative stuff that you guys come up with so that concludes the tutorial thanks very much for watching
Info
Channel: Blender Guru
Views: 908,660
Rating: undefined out of 5
Keywords: blender, camera, tracking, tutorial
Id: CVPcT0dJmoY
Channel Id: undefined
Length: 56min 51sec (3411 seconds)
Published: Thu Mar 08 2012
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.