Nuke Tutorial - Building 3D Environments with Camera Projections

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi guys Paul's an ingress here with another nuke tutorial today we're tackling the basics of 3d projection now I've gotten a few requests for projection tutorials and there are lots of different ways that you can use projection today what we're going to do is we're going to we're going to build a little simple three dimensional set using some of nukes 3d nodes and that's a good way to get started and learn the techniques and terminology of projection and then also to just kind of get a sense of the workflow and then we'll get into some more complicated stuffs where we combine projection with 3d camera tracking and use that to do paint outs and things like that but it's important to understand how projection works before we can really dive into that stuff so today what we're going to do is if you go to the show notes there is a tutorial eight image that I have provided and it's just a simple rundown kind of building I love using these these rundown sorts of buildings for for this sort of thing what we're going to do with this is we're going to build a little environment that is going to be three-dimensional and you can see this is it this is a 2d image right so if I decided to you know try and do a camera move in here or or push in there'd be no parallax there'd be no desk use that would make this feel like a 3d environment it would always read as a flat two-dimensional image with projection we can set up a simple set of cards in 3d space project this image onto it and build a very very quick and very very simple 3d environment that then we could use for for a background for a scene or something like that so to get started we're going to need to use some of nukes 3d nodes and we are going to use a camera node we are going to use a scene node cameras and scenes always go together we're going to use a scanline renderer node scanline renderer and scanline renderer allows us to take our 3d environment and turn it back into 2d when you see these round nodes like this each of 3d nodes they only operate in 3d in new 3d world and I can toggle back and forth between 3d world of 2d world with the tab key so you can see I've got a camera looks a lot like a camera that you'd see in any other 3d environment in any software package the scanline render node is going to take whatever contents of the scene and the view of the camera and turn that into a 2d image so we need that we need to connect the camera camera node to the camera pipe and I'm going to connect our environment image to the BG pipe so that way when I look through the scanline renderer I'm going to see whatever 3d stuff that I stick into the scene superimposed on top of our image now to get started I need a card and you'll notice when you type card you're going to see two different card nodes one is card 3d and one is card card 3d is not what we're using today card 3d a good way to remember this is if it says card 3d it's including all of these 3d nodes within it where it's card is designed to work with these nodes okay so the simpler one is what we want because we're doing the heavy lifting in terms of 3d with these other nodes ok card 3d is when you just simply want to do a little bit of 3d translation rotation scale or movement on a 2d image in an otherwise two-dimensional comp okay since we're using a 3d comp we're going to use just the card ok card has two pipes one out that's always going to go to your scene and one in that is going to be an image for now I'm going to add a grid I always use grids to start building my 3d environments and so I'm going to attach a grid so I've got a grid feeding to the image pipe card feeding into the scene camera feedings and scene camera also feeding into the scanline render scene feeding sorry about that seeing feeding into the object scene pipe on the scale and render and our image feeding into the BG pipe so this is how we get started so let's go over to the 3d mode and let's select our card okay so you should see it as this wireframe object you can see the grid if I take the grid pipe off you can see it better you can see the grid on there now the default grid size is one I usually like to take this up to ten to make those lines a little beefier so I can see them and then I'm going to start laying this grid these this grid card into my scene so that it replicates one of the planes in my image now I've got four planes to deal with I've got a floor I've got a ceiling I've got this right wall and I've got this back wall so I'm going to set up a card for each of these planes I'm going to use the grid tell me judge perspective help me judge focal length on the camera things like that so let's start with the floor I always start with the floor because it's kind of easy because you can always assume that the floor is laying flat all right and I'm just going to push it out into my scene a little bit you should see it right here you can't really see anything because it's right in the same plane as the camera now if I look at this scene the original image the camera is slightly above the floor you know by some some measure rent above the floor but it's pretty low which is why we can see the ceiling so I'm going to take this camera I'm just going to nudge it up a little bit until I can see this grid on the on ground right so I'm just kind of raised up enough to be able to see the grid and I'm going to move the grid a little bit further into the scene and what I'm going to start doing is looking at perspective cues now it's a good idea to set up a second view or some attention fewer too to just the the background so I can toggle back and forth really easily so one will get me the scanline render output and two gives me just the basic integer so I've got a prospective line here where the wall meets the floor and it's it's this where this white area meets the dark area it's actually pretty visible pretty easy from it for me to see so I'm going to use that as my perspective guide so I have to start manipulating the card to line up with that so I'm just going to start rotating the card on the y-axis and start looking at how this lines up and it's not bad what I actually want to do is I want to move this card over and try and get one of these grid lines to line up with it okay it's not terrible right it's a little lower here a little higher here so I have to make a couple of adjustments one of the things I might adjust is the camera rotation I definitely want to look at the camera field of view by default the camera has has defaulted to a projection length focal length of 50 I think when I look at this that that feels a little wider than a 50 to me that feels just from my my own experience with cameras that feels a little wider than a 50 to me it's not fishy I certainly but it's definitely wider than a 50 so I'm actually going to just take an educated guess and I'm going to adjust my focal length to say 35 okay I'm trying to stick to focal lengths that are fairly standard all right so let's see if we can get this looking a little bit better and there's a lot of guesswork in this projection workflow unless you've taken measurements with your scene there's a lot of guesswork I'm going to pull this back on this axis because I want to try and line this up with the back wall where the back wall meets the floor ideally what you want is your perspective lines to work on in two directions this way and this way I'm just going to back this up and I think I need to rotate my card a little bit more and I need to rotate on this axis which you know weird way is actually the y-axis if you're doing it by the numbers that's feeling pretty good on that back wall and let's take a look at the right the right wall it's pretty good it's not great it's pretty good I think that our next adjustment is going to be related to camera okay my floor is actually a little little lower here than the grid whereas here it lines up pretty well okay here it lines up pretty well back here not so much now I could fix this by you know making a tweak to the the floor plan but I won't like I said I want to just make an assumption that the floor is flat and level anytime I do this so that means the camera needs to tweak so let's take the camera and on it's translates let's just adjust the z-rotation a little bit to try and get these lines to line up better and let's look at the X rotation just a little bit to try and get it to line up better on here think I when I go this way yeah I'm gonna tilt down so I'm gonna go with a negative number and try and get that to match a little bit better and then it can probably just raise the camera up a little bit to get that line back up and again a lot of this is guesswork and a lot of it is just based on my my knowledge of cameras okay every compositor really needs to have knowledge of cameras and lenses and how these sorts of things work because otherwise you are compositing just from your own imagination which is never going to match reality all right so I've just nudged it on this green axis to get lined that up better and then I'm going to pull it on the x-axis to line this edge up with the with the where the floor meets the wall and I'm going to use that for for guides for for my two walls okay so having those edges actually line up it's going to work pretty nicely touch this back this way and I think I'm going to raise the camera just another smidge to get it to line up better something like that all right so you should see a nice grid that just kind of lays out lays in where the floor is and works pretty nicely okay so let's let's take this to the next step and so I can show you how this is all going to work okay and then we'll build the other walls in the ceiling so what we're going to use is a a node called project 3b and you'll notice project 3d has two incoming pipes and one outgoing pipe the incoming pipe is always going to be an image and a camera okay and the outgoing pipe is going to go to a piece of geometry like a card when I do this the grid is going to disappear and you're not going to really see any change where you will see the change is if I were to disconnect the BG pipe okay or if I were to simply go into the 3d environment and orbit my camera around there is the floor of our 2d environment projected in 3d space onto a flat plane onto a card okay so in other words my floor from my 2d image is now laid out in 3d space okay so let's let's undo this get rid of the project 3d for right now go back to my grid we'll come back to projector using a bit because now I need to build a ceiling a right wall on back wall so I'll start by duplicating duplicating the first card the floor card plugging that into my scene plugging the grid into it and then I'm just going to raise it to where I think the ceiling should be relative to the camera now because this is a rundown building my floor and ceiling are not super parallel to each other so I'm gonna have to make some adjustments okay now I could probably continue to refine the actual focal length of the camera to get this to fit better and you can do that but at at certain point it just becomes you're kind of chasing your own tail and I'd much rather spend the time a little bit more wisely and just make some adjustments just assume that the roof is no longer level that it has started to collapse and you can see in the corner that it is starting to come down so let's just make an assumption that the ceiling is not quite level and I'm going to make some adjustments to this card's angle so I'm going to alter it that far and you got to be really kind of careful with this make a couple of tweaks end up finding that I do it by the numbers more often than not basically what I want to do is I want to angle it down back here and I want to angle it down here and raise it up and I'm trying to try to line it up where it meets that back wall and also where it means this side wall and I'm not super worried about this if I wanted to get really really detailed and like you know bring in another card and angle it some more and get it to line up with the way that the roof is actually angled but for our purposes today we do not need to go that far with it I just want to try and get it kind of roughed in there and there's a lot of eyeballing and a lot of going back and forth raise it up just a smidge more I'm gonna call it good enough for for today's purposes okay so you should end up with something like that okay uh and it's it's really nice to have one of the roof or an all decrepit and nasty it's certainly helpful to have gridlines in the in the image because it can help you line up you see I'm not quite lined up but I'm close enough the nice thing is the projection technique is actually pretty forgiving within you know to some degree right there's going to be times when it's not going to be so forgiving when you're trying to try to use projection to do a pink gonna live action a live action shot but for this it's actually pretty for doing all right so two more walls so we're going to duplicate this card and then just rotate it up to be this wall and up to be this wall so copy paste plug this in right and now this card I'm just going to rotate it 90 degrees ish and I move it back line it right up with the edge of the floor rotate it so you should see something like this I might just nudge it that way a little bit yep that feels pretty good okay and don't worry about the overlap oops don't worry about the overlap if you if you really want to you can you can shrink this card down but I don't find that it's necessary you'll see once we start the projection it's not going to really be an issue so duplicate the card one more time and card four is going to become our back wall so I'm going to rotate it on this axis move it back good place and again you know you can be as precious with this as you want rotate it get it lined up as well as you possibly want to one thing I will try to be careful about is my overlaps I want to try to keep keep my cards you know just slightly overlapping but not too much and also try and keep angles the same so that the walls meet at a particular angle that feels consistent something like that close enough for the tutorial purposes all right so let's get our projection back in there so organize all of this stuff remove my grid disconnect all of these guys everything's going to turn black that's okay move my grid over here add a project 3d now projectory D it literally is what it says it is it's projecting an image in three dimensions okay so I'm going to project this image I'm using the camera now as a projector and every one of these cards is getting that image projected on it so you should now see a neat little 3d environment right nice little 3d environment and that works pretty well I didn't have to do any modeling I just simply slap four cards in there spend a little time lining them up and projected the image on okay and like I said a little bit of overlap is okay because it helps to hide these seams if you were to build these walls to be exactly the size of the walls in the image then you might see gaps in between it's helpful to not have that but what's nice is I don't have to use this for this camera as my scene camera anymore I'm going to disconnect it from the scanline renderer okay I'm also going to disconnect the background image from scanline renderer I'm going to set my full-size format now to HD 1080 and I'm going to add a new camera to my scene alright and this camera I'm gonna set to be a 24 millimeter focal length and I'm just going to move it in and up a little bit and actually I can fly this pretty deep into the scene since my card my background is so so high-res compared to 1080 I can actually push this in quite far let's just do a little key framing let's let's just do a little pullback and set a key and go back to the go to the last frame and which can pull this back slightly just keep pulling back I don't want to see the seams obviously I don't see edges alright and with that I now should have a pretty cool little camera move that is going to feel real it's going to feel like it's happening in three dimensions you're going to feel the parallax shift in the in the image it's not going to feel like I'm just doing a pan and scan on a simple two-dimensional image it can take a little while to render obviously once we get into 3d things take a little longer to to render previews but what this ends up being is a really versatile way to create environments for shots so if I needed to you know put actors in this space shoot the actors on the green-screen and put them in this space I could match the lens to what I used on the green screen and had this environment behave the way it really would if we were shooting this in this actual location it would feel very much like a real three-dimensional space because it kind of is but I'll have done is photomap these these textures of these four planes the floor ceiling right and back walls just projected them onto the 3d cards I've built simple geometry to simulate the 3d environment now obviously felt limitations if this image were lower resolution this would not work or it would it would work to a limited extent I wouldn't be able to push the camera in quite this far okay so the higher res your image the better and the more controlled your camera movement is the better obviously I have nothing there's no information off to the right or off to the left like I'm limited to only going as far back as the original image unless I wanted to do a whole bunch of paintwork and stuff like that which at that point of hunt as well spend the time building my own environment or find an adequate location to shoot on but this will give you an idea of kind of how projection works in 3d space gives you a little primer a little introduction to two 3d projections you can see my camera one here I no longer really need this I'm going to call this one projector camera projector and I'm going to make it no longer selectable and I'm going to turn it off I don't need to see it anymore it's doing its job but I don't need to see anymore this camera is my actual scene camera it's the one that matters it's the one that's actually doing the work the one that's actually creating this camera move so hopefully you found this helpful I really like projection it's one of my favorite techniques I use it all the time to to build simple environments I've used it to build complex environments like the interior of a nuclear reactor to built just from images that I found on Google and more importantly this is going to be a gateway to using projection to do more complex 3d based paint outs which we will get into in a future tutorial so if you like this make sure you click like and subscribe and leave me a comment let me know what else you want to see and I will see you during the next new tutorial stay tuned
Info
Channel: Paul DeNigris
Views: 46,547
Rating: 4.9515152 out of 5
Keywords: filmmaker, tutorial, visual effects, the foundry, nuke, vfx
Id: N2dW5He4jiY
Channel Id: undefined
Length: 26min 59sec (1619 seconds)
Published: Mon Jul 31 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.