Add DOF and Motion Blur to your C4D Render with After Effects

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey what's up everybody in this video I wanted to show you how to use the world position pass in cinema 4d to use an After Effects to achieve post depth of field and motion blur let's jump in hey what's up everybody this is Chad from grace go gorilla calm this is a video that was on Vimeo for a while and explained the process of extracting a z-pass out of the world position pass in cinema 4d the cinema 4d Z Pass is a little bit funky and won't work for post depth-of-field so in this tutorial I'm gonna break down how to use the world position pass to get a a good depth pass to use an After Effects to do post up the field then I'm going to show you how to apply the motion vector pass to use in After Effects for post motion blur let's get started okay so here we are in cinema and we've got this the shot that I've created with all these coffee beans falling through the frame for our Coffee Bean commercial that we're working on and we need to do this macro you know nice depth of field little motion blur action going on in the shot we want to create this really pretty product shot but we don't have a lot of time in fact we don't have a lot of time and we don't have the render power to do in camera depth of field and in camera motion blur so we need to do it in the comp in After Effects all right you heard me say that the Z pass coming out of cinema is incorrect well why is that let's take a look at it and see exactly why that is so let's go down and grab a depth pass and let's render it out and see what it does and I'm gonna show you exactly why it's wrong okay so here's our our depth pass rendered out of physical and you're saying to yourself well it looks right to me I've got you know the right amount of depth going on looks good I feel like it's right well it's not actually because most plugins that you use to do post up the field the main one being lens care depth of field it actually is expecting to see white being closest to the camera and black being furthest away well this is physical actually inverts that or cinema inverts that so if I jump into my filter tab over here and I say enable filter I can just show you what that looks like by inverting it so this is how most programs would expect to see a Z pass it's not a big deal because lens care you can actually flip it in after-effects you can tell it to interpret it you know as opposite so that's not really why this is wrong the bill big reason this is wrong is because of this anti aliasing anti aliasing is the enemy of Z pass why because Z passes work in luminance so every every step of luminance is a depth a measurement of depth from from from the camera essentially so imagine you know this gray coffee bean is you know 50 centimetres away from the camera this background is maybe 200 centimeters whatever so every single value every pixel value on the screen is gonna be associated with a depth right so we've got this problem we've got this anti aliasing so we've got these nice smooth edges what that does is it introduces gradients see this gradient right here these five or six pixels that I'm mousing over well that is gonna screw up lens care cuz lens care is gonna say well I don't understand where this pixel is in terms of the scene and what that's going to do is it's going to introduce weird fringing and little like problems along along the edges of your of your render of the of the depth of field so how do we fix this how do we get rid of that well you know a lot of people would actually create a whole separate take or a whole separate render and turn off anti-aliasing and do all this crazy stuff to work around this problem well I'm here to say there's a way easier way of doing it and if you follow these steps I think you'll find that it's it's it's well worth it it's it's it works really really well so let's turn off the filter and let's get back into our layer and we are going to talk about how we going to do this we're not going to actually even use a depth pass we are going to use what's called a world position pass WPP is the initials that you may have seen so let's go talk about world position passes okay so let's talk about the world position pass and what that is it's a it's a pass that you can get to just by going under effect and finding position pass and then it's gonna ask you what space do you want this position pass to be now what a position pass is is it's going to give a coordinate to every pixel that you render so every pixel that you render is gonna have an XY and z coordinate associated with it now the reason these passes are important is for compositing so a lot of programs like new confusion can use these world position pass to get build really nice atmosphere fog or depth masks that that can actually track with the scene we're not going to use it that way we're gonna actually cheat and use it to create a Z pass how do we do that well we don't want it to be world space we want it to be camera space because that's really where we're at we want things that are measured from the camera point of view so in camera space RG and B these three channels are going to mean three different things are is going to be left and right green is going to be up and down blue is going to be in and out that's exactly the channel that we're going to use the blue channel that in and out is going to be our Z pass so we don't want to invert the Z pass even though we could do that here to get it correct for lens care what that would do in camera space those it would flip the entire thing behind the camera and we wouldn't see anything so we're gonna leave that as it is don't touch that so you're gonna have to mess around a little bit with the scale because depending on your scene scale you're gonna want to screw around with this in order to get the right amount of gradient I happen to know that my scene is pretty small so I'm gonna do a point o2 on the scene scale on that so you can this is kind of something you're gonna have to experiment with to get that right alright so we've set up our position pass we'll go over in the motion vector I'm not even actually I'll just talk about it right now the motion vector pass pretty simple just enable it it just works you know straight out of the box not much to have to do there so let's go ahead and render this frame and look at these different passes okay so here is our world position pass rendered out so it looks weird it definitely does not look normal but trust me all the information that we need is in here if I come into the filter tab you're gonna see that if I start to isolate each RGB Channel I'm just going to isolate the red you can see the red is obviously going from from left to right we've got our green pass which is going up and down and then we've got our our blue which is actually going in and out it's going from the cameras pivot point out so this is the pass that we're going to use obviously we won't make it blue we'll make it you know black and white but we just need that luminance anyway so it's gonna be perfect for us but nots this isn't the reason why I like it the reason why I like it is because if we zoom in here there's no anti-aliasing and it actually takes that value of blue all the way to the edge of where the anti-aliasing would take place so let's just dive back into the Alpha Channel and you can see I still have the the blue Channel isolated here but you can see this is the anti-aliasing here that that's happening in my scene we've got like you know four or five pixels of gradiation if I jump back into my world position boom it actually covers that entire span of anti-aliasing so this is going to give us the perfect edge for doing our depth of field with lens care so we've got that working we've got our motion vector pass which I'm going to go ahead and turn off my filter for that got our motion vector pass we've got our world position pass and we've got our alpha we're actually not even going to use the Z pass that we set up before but we'll just leave it just to be safe so now let's set this thing up for actually rendering it out to EXR s all right so I'm not going to get too into the render settings themselves like the physical settings and whatnot I'm just gonna cover saving this out for EXR use so 1280 by 720 is fine obviously if I was doing a sequence I would do my sequence here I'm gonna jump down into save and I'm gonna enable it and you can see I've already kind of got it set up here I actually don't even turn on my regular image I only render out the multi pass and I choose open the XR my frame of choice as my frame format of choice and then I'm going to dive into my options here and I'm gonna choose 16-bit float zip in blocks of 16 lines now that's that sounds crazy like you're thinking well why do you want any compression well this compression is really really good it's going to keep these zxr files from getting really really big and the sixteen lines scanlines is going to be something that after-effects will read faster than any of the other compressions that i've tested so let's go ahead and okay and it's gonna it's actually a 16-bit float but it's still float don't worry about this this is just something that it you can't change this it's actually going to render out 16-bit float half load this you can't change don't worry about it we do want to turn on multi-layer file and layer name is suffix that's fine if we have an alpha you want to make sure that you've got your alpha turned on in this case we do so I have it turned on up here and just you know naming it something very obvious and putting in an obvious place we don't need to do anything else but that and we're pretty much set to go like right now all of these different passes are going to be baked inside of this one EXR file so I'm gonna pause the video and we're gonna jump into After Effects and take a look at what rendered out okay so here we are in after-effects we've got our e^x ours that we rendered out and I'm in After Effects CC 2015 so the two plugins that we're gonna be looking at here you're gonna need which is gonna be for shelf fresh lift for a hug god good luck pronouncing that one I was called lens care we're gonna use lens care depth of field and we're gonna use real smart motion blur if you don't have these two plugins this tutorial is probably not going to help you much okay so let's move into the EXR all right we've got our sequence here I'm gonna drag it down and create a comp and you can make sure that you want to make sure that you're in a 16-bit comp so you can hit alt and click on this little number here to go from 8-bit to 16-bit it's going to give us more color depth in all of our different channels so we brought our EXR pass in looks good we need to extract all of the different passes that we put in here the Z pass and the motion back pass out of this EXR how do we do that well we're gonna right-click in the in the effects panel or you can come over here and search for it doesn't really matter and we're gonna go down to 3d Channel extract or an extract or was made by this F Nord where place by a dude named Brendan bolus or bowles and what it does is it extracts all the different channels out of your EXR and allows you to shuffle them into RGB and alpha in any way you want so if I just click down in here you can see I can choose out of my layers you can see all my different passes that I set up are actually sitting inside the cxr just waiting to be released so let's say if I go to motion vector pass for instance and I hit okay we're going to see our motion vector pass if I say oh I want to see the world position pass I can say okay let's look at the world position pass it's really dim but you can see it's there so this is how we're going to extract all of our different passes out of our EXR to use them with the depth-of-field plugin and real smart motion blur so i'm gonna open up the comp that i made when i put together that little behind-the-scenes coffee video and we're gonna walk through that step by step and then i'm gonna show you how to create it by yourself okay so here we are in After Effects got our comp loaded and I'm just gonna walk you through how this comp was built and then we're gonna dive into the Z pass so starting with just our base render this is what came out of physical out of cinema in fact let's just kind of make that bigger so there's no depth of field there's no motion blur and it doesn't look very photographic so we need to add that depth of field that motion blur to make this really come to life and some color correction as well so the first layer is an adjustment layer that's what you want to use when you're doing post up the field and post motion blur they always want to be on adjustment layer so that they can affect everything below it in particular the depth of field if I wanted to rebuild this gradient this gradient was actually in the render I just going ahead and turned off the Alpha so that you could see the background we could build our own background but I figured might as well just use the one that was built in so we've got our depth of field I'm going to turn that on so you can see the effect of that so there's our depth of field we've got some nice fall-off of the focus looks a lot more photographic then the next thing I'm gonna do is add my motion blur layer which I'm gonna go through all this in more detail later so the motion blur now adds the motion blur of the the beans falling and whatnot so it looks even more photographic and then the last one is just an adjustment layer with some color correction exposure changes add a little bit of grain so let's go take a look at that so that's really the final result right there so how did we get the how do we get that Z pass to work out of these EXR s so I'm gonna dive into this z pass pre comp that I made so this is what is driving the the the frill shift depth of field and I'll watch I'll walk you through that in a minute too so how did we get from a world position pass to this okay so that's the that's the question because really our if you look at what we started with it looks like I'm gonna just do this this is if you remember what we looked at before it looked like this I'm just bringing us back to the square one here okay remember it before it could like I don't know if you can even see that but if there's just a little bit of that hint of of that blue so this position pass needs to be clamped because I can't even see the data that's in here so I'm gonna clamp my white point on this extractor to point to okay so now I'm seeing it a lot better I can see there's a gradient see there's some depth but we don't need the red and the green channel we need to actually put the blue channel into all three RG and B so down here I'm going to click on the extractor again and I'm gonna pipe the blue into our G and B so now it's gonna be blue blue blue and I'm gonna hit OK and there we go now it's starting to look more like a Z pass and of course we still got our great edges that are gonna be perfect and not give us any sort of fringing so with that the next thing you want to do is if you look down here what i did was i lu-- Makita it so i'm actually just going to go back to that top layer and let's turn off everything here and let's grab a luma key so if you're like me and you're lazy you're just gonna come over here type looma and I'm just gonna drag this over all right so the luma key is gonna keep what's darker and because there's no anti-aliasing here I just need to have my threshold of one and boom it knocks out all of that black and I've got as long as you don't have a background in your render and it's just you know goes off to infinity you're good here like this this will work for you so now what this allows me to do is allows me to comp this over a background color that I choose like how far back does my back want to be and that's what this solid is back here so I just put a light gray solid thinking okay well I think that my background is probably remember remember that you know the way that cinema inverts at z-pass white is really really far away I didn't make it like completely white because I didn't want the background to be like you know in the farthest region of space so I made it just a little bit gray and so this is looking pretty good so then the next thing I did was inverted so I just grabbed in an adjustment layer which is right here and I just inverted it I'm gonna turn that on and you can see I'm gonna turn off the levels first so I did a simple invert right so just brought it into a Z pass that that froze lifter lens care gotta stop saying that word is expecting where the white as close as the camera black is furthest away so that's what this did that invert actually did that for me but I want to clamp the levels because I don't want this much space I want there to be a little bit more contrast in this so that my depth of field is a little bit more intense so I'm gonna hit levels and all I did in levels was if I open this up is I just clamped it if I reset this down let me see if you can see this you look at your levels and in our histogram you can see there's data here in the middle of the histogram so this is my black and this is my white so all I'm gonna do is say okay well I'm gonna clamp my black to somewhere in here and I'm gonna clamp my white to somewhere in there now it's pretty good and now we've got what I would consider to be a good Z pass we're doing post up the field I can see there's some you know my farthest beam is getting black and my closest beam is gay white so I know that I'm gonna get good depth of field out of this so that's all you need to do for the depth Pass we did it we comped it yay now let's jump back into our comp and see how that's being applied I'm gonna turn off the motion blur and I'm just gonna get into my depth of field and I'm gonna delete this plugin and we're gonna do this from scratch okay so we don't have well in fact we'll do it completely from scratch in fact I will create an adjustment layer by hitting ctrl alt and Y and I'll drag this adjustment layer down and we'll rename it to depth of field and I'm gonna grab the depth of field if I could spell there it is the full shrimp depth of field drag it on to the adjustment layer and immediately it's gonna be looking for a layer to say okay well what do you want the depth to be well it's this pre comp that we made this was e-pass pre comp that we were just in so I'm going to select that depth layer right there and I'm gonna give it a radius because right off the bat at 0 it's gotten absolutely no blur whatsoever so I'm gonna change it to 15 and then you can see immediately it got a little bit and trying to make this window a little bit bigger for you let's see here we don't need quite we don't need to really see that anymore so I'm just gonna move some of these around so you can see it a little bit better all right there we go okay so now we've got a little bit of blur happening and we have the ability to choose our focal point with this little pointer here so if I wanted to let's say I don't know choose a different point for this guy a focus like it could be maybe this guy and now that guy's in focus or I could move it around to let's say this guy and he's in focus and the other guys fall out of focus so that's that's how you can choose a focus I actually kind of prefer to do it the other way which is to select show and say sharp zone and you can see it gives you like this little preview of where your focal point will actually be and then I can come in here and start to change my my focal point and just kind of walk it back through the scene and pick exactly where I want my focus to be which is gonna be on this beam right here so with that I'm gonna go back into my normal blur and I might turn it up just a little bit maybe like 220 and you can see barely see it but you can sort of see in here that we've got really nice edges happening got really nice blur happening there's no fringing that you get with with the anti-aliasing pass it's working out really good for us okay so now we're ready to talk about the motion blur part of this tutorial so let's dive into this motion vector pass pre-comp we got our motion vectors loaded here that's really all you need is your UE XR is loaded you've got an extractor on here and you're using the motion vector layers here so hit OK should look something similar to this it'll look less intense if things aren't moving very quickly so let's try back in or a comp and let's just kill this real smart motion blur so we have an adjustment layer here on top of the depth of field and we're gonna go ahead and grab a real smart motion blur right there and for the alternate motion source we're going to choose that pre comp so we're going to choose that vector pass pre comp and let's turn off the depth of field so you can see it so here's with out it and with it on so we've got some really nice motion blur happening now the great part is because it's on top of the depth of field I can turn the depth of field on and it it actually works with both and it it gives you really nice edges we can just make that fullscreen one thing to remember is these pre comps here the Z pass pre comp and the motion vector pass pre comp need to be on top of these adjustment layers because if these were below these adjustment layers these adjustment layers would be affecting those passes as well so you always want to keep those on top and keep them invisible because we're only using them to drive these two adjustment layers so once we've got the real smart motion blur in and we've got our depth of field already in place we can start to tweak things in if we look at our adjustment layer here at the top I've got a lot that I've applied I've got a little exposure change a little hue/saturation a little bit of grain and that's really all I needed to get the look that I wanted and we can kind of click through here if we wanted to we could actually animate the the focal point to like maybe it's wracking focus or something and feels like maybe the motion blurs a little bit too intense so I'm gonna grab the motion blur and bring that down to like a point three five that looks a little bit better and now we can just Ram preview a little bit of that and that's gonna take a while that's the one other bad thing about After Effects ndx ours is that they can take a little bit of time so let's just look at it as 50% and let's make sure that we're doing half rays on our previews there we go that's a lot easier so here we have our motion blur and our depth of field all happening if we wanted to increase the motion blur we could easily do that bring that up to like a 6 if we wanted to now we're gonna get even more motion blur especially on that guy that's falling down there yeah so that is how you get post up the field and post motion we're working with a Z pass extracted from your world position pass I hope you enjoyed the tutorial hit me in the comments of any questions and we'll see you next time
Info
Channel: Greyscalegorilla
Views: 64,166
Rating: undefined out of 5
Keywords: cinema 4d, c4d, tutorials, greyscalegorilla, Cinema 4D, how to add depth of field after effects, how to add motion blur after effects, post dof after effects, post motion blur after effects, how to use a zpass, how to use a z-pass, how to use a world position pass c4d, how to use a zpass c4d, how to use a z-pass c4d, cinema 4d after effects compositing, cinema 4d depth of field tutorial, after effects depth of field tutorial
Id: hej9gSpXKqQ
Channel Id: undefined
Length: 23min 41sec (1421 seconds)
Published: Fri Mar 02 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.